[asterisk-bugs] [Asterisk 0013926]: [patch] Allow for adding message body to the SIP NOTIFY message

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Nov 20 16:16:33 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13926 
====================================================================== 
Reported By:                jthurman
Assigned To:                putnopvut
====================================================================== 
Project:                    Asterisk
Issue ID:                   13926
Category:                   Channels/chan_sip/NewFeature
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.6.0.1 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-11-18 15:15 CST
Last Modified:              2008-11-20 16:16 CST
====================================================================== 
Summary:                    [patch] Allow for adding message body to the SIP
NOTIFY message
Description: 
After some packet captures to see why my Cisco 79x1 phones were not
resetting with the build in "sip notify" console command, I found that the
phones require some XML instructions in the message body.  Attached is a
patch for 1.6.0.1 that is based on bug 12962.  I would like to see this
feature added so others can remotely reboot the Cisco 79x1 phones from the
console when needed!

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0012962 [patch] Change the "sip notify&quo...
has duplicate       0013928 Allow for adding message body to the SI...
====================================================================== 

---------------------------------------------------------------------- 
 (0095211) putnopvut (administrator) - 2008-11-20 16:16
 http://bugs.digium.com/view.php?id=13926#c95211 
---------------------------------------------------------------------- 
This is a good idea since there is currently no way to add any lines to the
body of a NOTIFY using the sip notify CLI command. From an implementation
standpoint, there are no flaws at all with this patch as far as I can see,
but I do have some comments.

1. While I like and prefer the 0 == strcmp notation, it doesn't fit well
with the rest of Asterisk's coding style, which is to use !strcmp instead.

2. I would suggest using a case-insensitive comparison for the word
"Message-Body" to help ease-of use.

3. Since you have a real-world example where this is useful, it would be a
good idea to add a new entry to sip_notify.conf.sample in the configs/
directory showing how the Message-Body variable can be used. I would
suggest just copying and pasting what you are using to reset your Cisco
phones.

4. Since this is a new feature, we need to have the patch made against
trunk instead of the 1.6.0.1 tag. This actually has an extra side-benefit
as well. Since the transmission of custom NOTIFY information is in its own
function in trunk, it means that you are not only adding the ability to add
the message body in the sip notify CLI command, but also the SIPnotify
Manager action as well.

Thanks for the submission! 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-11-20 16:16 putnopvut      Note Added: 0095211                          
======================================================================




More information about the asterisk-bugs mailing list