Skip to content
Snippets Groups Projects
Commit f8b2c9e1 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

add voicemail notification for the IAX account

parent af7402ac
Branches
Tags
No related merge requests found
...@@ -730,6 +730,10 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call) ...@@ -730,6 +730,10 @@ IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
void void
IAXVoIPLink::iaxHandleRegReply(iax_event* event) IAXVoIPLink::iaxHandleRegReply(iax_event* event)
{ {
int voicemail;
std::string account_id;
if (event->etype == IAX_EVENT_REGREJ) { if (event->etype == IAX_EVENT_REGREJ) {
/* Authentication failed! */ /* Authentication failed! */
_mutexIAX.enterMutex(); _mutexIAX.enterMutex();
...@@ -738,9 +742,19 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event) ...@@ -738,9 +742,19 @@ IAXVoIPLink::iaxHandleRegReply(iax_event* event)
_regSession = NULL; _regSession = NULL;
setRegistrationState(ErrorAuth); setRegistrationState(ErrorAuth);
} }
else if (event->etype == IAX_EVENT_REGACK) { else if (event->etype == IAX_EVENT_REGACK) {
/* Authentication succeeded */ /* Authentication succeeded */
_mutexIAX.enterMutex(); _mutexIAX.enterMutex();
// Looking for the voicemail information
//if( event->ies != 0 )
voicemail = event->ies.msgcount;
_debug("iax voicemail number notification: %i\n", voicemail);
// Notify the client if new voicemail waiting for the current account
account_id = getAccountID();
Manager::instance().startVoiceMessageNotification(account_id.c_str(), voicemail);
iax_destroy(_regSession); iax_destroy(_regSession);
_mutexIAX.leaveMutex(); _mutexIAX.leaveMutex();
_regSession = NULL; _regSession = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment