Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
b7f9d3a0
Commit
b7f9d3a0
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
fix bug with the voicemail number in IAX
parent
57c9285b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/iaxvoiplink.cpp
+27
-7
27 additions, 7 deletions
src/iaxvoiplink.cpp
src/iaxvoiplink.h
+11
-0
11 additions, 0 deletions
src/iaxvoiplink.h
with
38 additions
and
7 deletions
src/iaxvoiplink.cpp
+
27
−
7
View file @
b7f9d3a0
...
@@ -263,8 +263,6 @@ IAXVoIPLink::sendAudioFromMic(void)
...
@@ -263,8 +263,6 @@ IAXVoIPLink::sendAudioFromMic(void)
// available bytes inside ringbuffer
// available bytes inside ringbuffer
availBytesFromMic
=
audiolayer
->
canGetMic
();
availBytesFromMic
=
audiolayer
->
canGetMic
();
_debug
(
"max bytes=%i - avail = %i
\n
"
,
maxBytesToGet
,
availBytesFromMic
);
if
(
availBytesFromMic
<
maxBytesToGet
)
{
if
(
availBytesFromMic
<
maxBytesToGet
)
{
// We need packets full!
// We need packets full!
return
;
return
;
...
@@ -752,7 +750,7 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
...
@@ -752,7 +750,7 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
IAXVoIPLink
::
iaxHandleRegReply
(
iax_event
*
event
)
IAXVoIPLink
::
iaxHandleRegReply
(
iax_event
*
event
)
{
{
int
voicemail
;
int
new_
voicemail
s
;
std
::
string
account_id
;
std
::
string
account_id
;
if
(
event
->
etype
==
IAX_EVENT_REGREJ
)
{
if
(
event
->
etype
==
IAX_EVENT_REGREJ
)
{
...
@@ -770,11 +768,11 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event)
...
@@ -770,11 +768,11 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event)
// Looking for the voicemail information
// Looking for the voicemail information
//if( event->ies != 0 )
//if( event->ies != 0 )
voicemail
=
event
->
ies
.
msgcount
;
new_
voicemail
s
=
processIAXMsgCount
(
event
->
ies
.
msgcount
)
;
_debug
(
"iax voicemail number notification: %i
\n
"
,
voicemail
);
_debug
(
"iax voicemail number notification: %i
\n
"
,
new_
voicemail
s
);
// Notify the client if new voicemail waiting for the current account
// Notify the client if new voicemail waiting for the current account
account_id
=
getAccountID
();
account_id
=
getAccountID
();
Manager
::
instance
().
startVoiceMessageNotification
(
account_id
.
c_str
(),
voicemail
);
Manager
::
instance
().
startVoiceMessageNotification
(
account_id
.
c_str
(),
new_
voicemail
s
);
iax_destroy
(
_regSession
);
iax_destroy
(
_regSession
);
_mutexIAX
.
leaveMutex
();
_mutexIAX
.
leaveMutex
();
...
@@ -787,6 +785,28 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event)
...
@@ -787,6 +785,28 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event)
}
}
}
}
int
IAXVoIPLink
::
processIAXMsgCount
(
int
msgcount
)
{
// IAX sends the message count under a specific format:
// 1
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | 0x18 | 0x02 |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | Old messages | New messages |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// For now we just need the new messages informations.
// Thus:
// 0 <= msgcount <= 255 => msgcount new messages, 0 old messages
// msgcount >= 256 => msgcount/256 old messages , msgcount%256 new messages (RULES)
return
msgcount
%
256
;
}
void
void
IAXVoIPLink
::
iaxHandlePrecallEvent
(
iax_event
*
event
)
IAXVoIPLink
::
iaxHandlePrecallEvent
(
iax_event
*
event
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/iaxvoiplink.h
+
11
−
0
View file @
b7f9d3a0
...
@@ -191,6 +191,17 @@ class IAXVoIPLink : public VoIPLink
...
@@ -191,6 +191,17 @@ class IAXVoIPLink : public VoIPLink
void
updateAudiolayer
(
void
);
void
updateAudiolayer
(
void
);
private
:
private
:
/*
* Decode the message count IAX send.
* Returns only the new messages number
*
* @param msgcount The value sent by IAX in the REGACK message
* @return int The number of new messages waiting for the current registered user
*/
int
processIAXMsgCount
(
int
msgcount
);
/**
/**
* Get IAX Call from an id
* Get IAX Call from an id
* @param id CallId
* @param id CallId
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment