Summary:ASTERISK-13089: [patch] Allow for adding message body to the SIP NOTIFY message
Reporter:Jonathan Thurman (jthurman)Labels:
Date Opened:2008-11-18 15:15:19.000-0600Date Closed:2009-10-21 18:46:55
Versions:Frequency of
causesASTERISK-20805 SIP Notify message has incorrect IP address in FROM field
Environment:Attachments:( 0) 79x1-reset.png
( 1) notify-message-body.patch
( 2) sip_notify_withbody.v1.diff
( 3) sip-notify-svn189463.diff
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 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!


Reference Bug:  http://bugs.digium.com/bug_view_page.php?bug_id=12962
Comments:By: Leif Madsen (lmadsen) 2008-11-19 15:46:21.000-0600

Assigned to putnopvut because it looks pretty trivial, and I think he has knocked down that list of 15 a bit... :)

By: Mark Michelson (mmichelson) 2008-11-20 16:16:32.000-0600

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 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!

By: Leif Madsen (lmadsen) 2008-12-22 11:22:27.000-0600


It's been a month since putnopvut made some suggestions for changes to the patch from the original reporter. Is the reporter still interested in moving this patch forward?

By: Igor Goncharovsky (igorg) 2008-12-24 22:27:24.000-0600

Patch uploaded. It is include work for almost all suggestions, except including example in sip_notify.conf.sample because I have no devices that need body in NOTIFY request.

By: Leif Madsen (lmadsen) 2008-12-29 08:34:13.000-0600

Thanks for the updated patch Igor! I've moved this back to Confirmed!

By: Gareth Palmer (gareth) 2009-03-05 19:13:01.000-0600

I have uploaded a patch for SVN-189463. Changed variable name to 'Content' rather than 'Message-Body'.

I've also verified that the cisco-check-cfg notify type works as expected.

By: Alec Davis (alecdavis) 2009-04-19 17:11:27

Wouldn't it be nice to be able to do this from the dialplan as well.
Not necessarily to reboot a phone, but to request it to update it's idle screen, or the play a new decks of cards (cisco XML).

See http://bugs.digium.com/view.php?id=14488 I got it done and working, but for completeness wanted to know that the phone did indeed get the notification, by waiting for the 200 OK.

By: Igor Goncharovsky (igorg) 2009-04-21 09:07:22

It is good idea to make updates also from dialplan, but I think it is different work to make available in dialplan results of SIP dialog.

By: Jonathan Thurman (jthurman) 2009-05-19 20:56:17

 How did you test your patch?  Can you state what type of phone, and your configuration?  I have been unable to make this work with any Cisco 79x1 phones, which I am still looking into.

By: Gareth Palmer (gareth) 2009-05-20 17:56:04


I tested it with a 7960. I have not been able to find any examples of the XML & SIP-headers required to reboot the 79x1 phones.

By: pj (pj) 2009-05-21 03:51:16

I'm attaching picture  79x1-reset.png from packet dump analyser,
it shows what callmanager6 uses to reset java based phones (79x1)
currently, we are able to put sip header, using sip_notify.conf:
Event: service-control
Content-Lenght: 82
but if you look at this picture, callmanager6 also uses message body, where is placed actual action to reset or restart these new phones...

By: Digium Subversion (svnbot) 2009-10-14 12:52:49

Repository: asterisk
Revision: 224035

U   trunk/CHANGES
U   trunk/channels/chan_sip.c
U   trunk/configs/sip_notify.conf.sample

r224035 | jpeeler | 2009-10-14 12:52:48 -0500 (Wed, 14 Oct 2009) | 12 lines

Allow for adding message body to the SIP NOTIFY message

Ability has been added to both manager command SIPnotify as well as console
command sip notify. Message body is stored in the "Content" variable. An
example is present in sip_notify.conf.

(closes issue ASTERISK-13089)
Reported by: jthurman
     sip-notify-svn189463.diff uploaded by gareth (license 208)
Tested by: gareth



By: Digium Subversion (svnbot) 2009-10-14 12:53:11

Repository: asterisk
Revision: 224036

_U  branches/1.6.2/

r224036 | jpeeler | 2009-10-14 12:53:10 -0500 (Wed, 14 Oct 2009) | 18 lines

Blocked revisions 224035 via svnmerge

 r224035 | jpeeler | 2009-10-14 12:48:57 -0500 (Wed, 14 Oct 2009) | 12 lines
 Allow for adding message body to the SIP NOTIFY message
 Ability has been added to both manager command SIPnotify as well as console
 command sip notify. Message body is stored in the "Content" variable. An
 example is present in sip_notify.conf.
 (closes issue ASTERISK-13089)
 Reported by: jthurman
       sip-notify-svn189463.diff uploaded by gareth (license 208)
 Tested by: gareth