Summary:ASTERISK-03168: [patch] Add a CLI command to send SIP notify to peers (ex:reboot phone)
Reporter:mochouinard (mochouinard)Labels:
Date Opened:2005-01-03 02:33:07.000-0600Date Closed:2008-01-15 15:19:43.000-0600
Versions:Frequency of
Environment:Attachments:( 0) cisco.txt
( 1) sip_notify.txt
Description:This patch add the posibility to send notify defined in a new sip_notify.conf.
So can do this :
sip notify Type PEERNAME


This patch was about rebooting SIP phone, but I changed it due to comments about making it more general.  The example notify for reboot have being tested on Polycom phone. Please update if it not working, or how to make it working (with other phone type also)

Comments:By: Kevin P. Fleming (kpfleming) 2005-01-03 09:53:46.000-0600

I like this quite a bit, and the implementation looks pretty sound. Note that "sip_completepeer" will not quite do what you think until bug 3221 is merged and the syntax is changed to allow early exit from the loop. Also, since you are only comparing the name, you can forgo the RDLOCK/UNLOCK stuff, as the name values are constant as long as the entry is in a container, and CONTAINER_TRAVERSE holds the lock on the container (new bug coming to optimize FIND to use the same technique). If you do make this change, please leave a comment in the code describing why you are not locking/unlocking, so that future copiers of your code don't assume they can look at other fields without locking.

edited on: 01-03-05 10:27

By: mochouinard (mochouinard) 2005-01-03 12:42:33.000-0600

Lastest patch use configurable phone config, here is a example sip_reboot.conf


By: Kevin P. Fleming (kpfleming) 2005-01-03 13:01:59.000-0600

Your patch will need to include a sip_reboot.conf.sample in the configs directory, ideally with the most common entries already included.

Also, if there is any other thing (besides reboot) that these NOTIFY messages can be used for, then the command and config file should probably be renamed to something more generic.... "sip notify <type> <peer>"? If you decide to do that, you'll want to offer command completion on the notify types, as well as the peer name.

edited on: 01-03-05 13:02

By: mochouinard (mochouinard) 2005-01-03 13:09:02.000-0600

I know, Ive being thinking about that.  making it sip notify instead of sip reboot... but let see if anyone have any application for it other than reboot.  Maybe it still better to call it sip notify also ...

By: mochouinard (mochouinard) 2005-01-03 15:01:59.000-0600

Here is another version that use more general notify system, also included a sample config file.

Please test and let me know how it goes.

By: Mark Spencer (markster) 2005-01-04 00:15:31.000-0600

Added to CVS, thanks!

By: Clod Patry (junky) 2005-01-04 10:34:05.000-0600

Re-open for wolfson can add comments related to cisco phones.

By: wolfson (wolfson) 2005-01-04 16:38:15.000-0600

Cisco phones do not seem to like this. I have attached a packet log with a Cisco phone.

By: Brian West (bkw918) 2005-01-04 16:50:31.000-0600

contact is wrong.. you have to direct it at a contact on the phone... check the cisco docs.. this could be a small issue to use the FULL contact in that field.


By: Kevin P. Fleming (kpfleming) 2005-01-04 16:58:05.000-0600

Hmm, that's strange. It shouldn't be requiring SDP for a NOTIFY message. Then again, according to RFC3265 NOTIFY is not supposed to be sent except as part of a subscription created with SUBSCRIBE anyway, so using it this way is somewhat outside the specs anyway. In spite of that, phone implementors are using it for this function :-)

By: Kevin P. Fleming (kpfleming) 2005-01-04 17:00:11.000-0600

Yeah, these packets are not being constructed properly. I've already opened a new bug with a rebuilt version of this, let me try to figure out how to get them built correctly...

By: nick (nick) 2005-01-04 20:05:01.000-0600

Let's carry the fun on in 3243 to avoid duplicating efforts...

By: Digium Subversion (svnbot) 2008-01-15 15:19:43.000-0600

Repository: asterisk
Revision: 4656

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

r4656 | markster | 2008-01-15 15:19:43 -0600 (Tue, 15 Jan 2008) | 2 lines

Allow generic sip notify (bug ASTERISK-3168)