Summary:ASTERISK-02744: SIP Notify / Message waiting does not conform to RFC.
Date Opened:2004-11-04 20:04:06.000-0600Date Closed:2008-01-15 15:12:52.000-0600
Versions:Frequency of
Environment:Attachments:( 0) asterisk-chan_sip-mwi_notify_fix.patch
Description:In testing the new Sayson 480i phone which displays the total number of voicemail messages waiting on the idle screen, it looks like chan_sip does not currently conform to the SIP Message Waiting RFC 3842.  (ftp://ftp.rfc-editor.org/in-notes/rfc3842.txt)  The RFC suggests that the NOTIFY sip message contain the keyword "Voice-Message" and not "Voicemail" as currently implemented in chan_sip.  Currently NOTIFY messages from Asterisk appear as follows:

NOTIFY sip:101@ SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK10fd2238
From: "asterisk" <sip:asterisk@>;tag=as4512d69d
To: <sip:101@>
Contact: <sip:asterisk@>
Call-ID: 003d08a039ebeb94136d90987735a67a@
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 39
Messages-Waiting: yes
Voicemail: 1/0

Line 3879 of chan_sip.c currently reads:
snprintf(tmp2, sizeof(tmp2), "Voicemail: %d/%d\r\n", newmsgs, oldmsgs);

It should be:
snprintf(tmp2, sizeof(tmp2), "Voice-Message: %d/%d\r\n", newmsgs, oldmsgs);

I made this change locally and it appears to have corrected the problem as my 480i now properly displays the total number of voicemail messages waiting.
Comments:By: () 2004-11-04 20:07:35.000-0600

Oops! Forgot to mention that the section detailing this feature is located in "3.5.  NOTIFY Bodies" on page 4 of the RFC document.

By: Brian West (bkw918) 2004-11-04 21:04:16.000-0600

Can you please provide a patch? and fax a disclaimer please.


By: () 2004-11-04 22:01:38.000-0600

I think I made the patch correctly.  Disclaimer has been sent to Digium.

By: Mark Spencer (markster) 2004-11-07 13:43:12.000-0600

Fixed in CVS.  Yay SIP -- text formats are *so* much less confusing than binary formats...

By: Russell Bryant (russell) 2004-11-07 19:22:28.000-0600

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:12:52.000-0600

Repository: asterisk
Revision: 4181

U   branches/v1-0/channels/chan_sip.c

r4181 | russell | 2008-01-15 15:12:52 -0600 (Tue, 15 Jan 2008) | 2 lines

fix sip mwi to conform to RFC (bug ASTERISK-2744)