Re: [asterisk-users] Server-side scripting when SIP phones register
Hi, Using AMI, when a peer is set with Qualify=yes, it seems you can't make a difference between First-time registration and Re-registration. Looking at an AMI log, I saw: Re-registration (to be confirmed): Event: PeerStatus Privilege: system,all ChannelType: SIP Peer: SIP/7266 PeerStatus: Registered Address: 10.10.20.109 Port: 5060 First-time registration (after pluging back a SIP phone): Event: PeerStatus Privilege: system,all ChannelType: SIP Peer: SIP/7275 PeerStatus: Registered Address: 10.10.20.104 Port: 5060 If this 2nd message was different from the 1st one, it would possible to get this server-side feature. Example of first-time registration: Event: PeerStatus Privilege: system,all ChannelType: SIP Peer: SIP/7275 PeerStatus: Registered Address: 10.10.20.104 Port: 5060 SubPeerStatus: First I'm not enough aware of SIP channel internals to tell if it does make sense to hope to have this distinction made between registrations. Regards ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Server-side scripting when SIP phones register
H Oliver, You may be able use AMI to catch the Register event (PeerStatus or Registry - depending on what you're trying to do and how often you need to do it) and SIPpeers to get the device address. YMMV. For example, when a SIP device "registers" to asterisk for the first time, you see the following event from AMI: Event: PeerStatus Privilege: system,all Peer: SIP/ PeerStatus: Registered The SIPpeers request will give you entries that look like this: Event: PeerEntry Channeltype: SIP ObjectName: ChanObjectType: peer IPaddress: 10.10.X.Y IPport: 5060 Dynamic: yes Natsupport: no VideoSupport: yes ACL: no Status: OK (96 ms) RealtimeDevice: no With some manipulation, you can match the Peer in the PeerStatus event with the ObjectName in the PeerEntry event. Now you have the notice of the registration and the IP address of the device. Keep in mind that you may also see the events like below in the natural course of business as a result of a vendor's implementation of the SIP specification: Event: PeerStatus Privilege: system,all Peer: SIP/ PeerStatus: Unregistered Cause: Expired Quickly followed by: Event: PeerStatus Privilege: system,all Peer: SIP/ PeerStatus: Registered These are due to registrations expiring and the device registering again. The frequency of this is largely controlled by the device and you'll have to check with your vendor(s) on how often you'll see those. This may have an impact on your design, but it's important to note that the device doesn't just register once and go away. Once you've captured that, there are a variety of ways to send the SIP MESSAGE back to the phone. Sipsak and some other tools do a fairly good job, but you'll need to evaluate if they meet your scaling needs. Regards, Elliot From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Olivier Sent: Thursday, October 08, 2009 10:30 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Server-side scripting when SIP phones register Hi, Some IP Phones (Aastra) are able to send a custom HTTP request just after registration completion. Using this, it is possible to update phone's screen with messages like "Do Not Disturb" or "Forwarded To VM". RFC 3680 (http://www.faqs.org/rfcs/rfc3680.html) provides a mecanism to support these interactions. To my knowledge, this RFC is not implemented yet in Asterisk. Has someone found a workaround to that some scripting could be run whenever a SIP phones registers ? Regards This message is intended only for the use of the individual (s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to Calling Circles LLC and its affiliates. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Server-side scripting when SIP phones register
You are correct that the dialplan isn't called on a registration. The "correct" way to handle this would be to modify chan_sip.c to do an action when a phone registers. The "hacky" way would be to capture sip debug to a log and process that with a daemon.You could always post a bounty. _ From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Olivier Sent: Thursday, October 08, 2009 11:20 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Server-side scripting when SIP phones register 2009/10/8 Danny Nicholas You should be able to do this either via a system command or an AGI. How ? When a phone registers for the first time, IMHO, no part of dialplan is launched, is it ? Using AMI to be notified of such registrations must be possible but I don't know if it's possible to distinguish first-time registrations from re-registrations ? _ From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Olivier Sent: Thursday, October 08, 2009 9:30 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Server-side scripting when SIP phones register Hi, Some IP Phones (Aastra) are able to send a custom HTTP request just after registration completion. Using this, it is possible to update phone's screen with messages like "Do Not Disturb" or "Forwarded To VM". RFC 3680 (http://www.faqs.org/rfcs/rfc3680.html) provides a mecanism to support these interactions. To my knowledge, this RFC is not implemented yet in Asterisk. Has someone found a workaround to that some scripting could be run whenever a SIP phones registers ? Regards ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Server-side scripting when SIP phones register
2009/10/8 Danny Nicholas > You should be able to do this either via a system command or an AGI. > How ? When a phone registers for the first time, IMHO, no part of dialplan is launched, is it ? Using AMI to be notified of such registrations must be possible but I don't know if it's possible to distinguish first-time registrations from re-registrations ? > > -- > > *From:* asterisk-users-boun...@lists.digium.com [mailto: > asterisk-users-boun...@lists.digium.com] *On Behalf Of *Olivier > *Sent:* Thursday, October 08, 2009 9:30 AM > *To:* Asterisk Users Mailing List - Non-Commercial Discussion > *Subject:* [asterisk-users] Server-side scripting when SIP phones register > > > > Hi, > > Some IP Phones (Aastra) are able to send a custom HTTP request just after > registration completion. > Using this, it is possible to update phone's screen with messages like "Do > Not Disturb" or "Forwarded To VM". > > RFC 3680 (http://www.faqs.org/rfcs/rfc3680.html) provides a mecanism to > support these interactions. > > To my knowledge, this RFC is not implemented yet in Asterisk. > Has someone found a workaround to that some scripting could be run whenever > a SIP phones registers ? > > Regards > > ___ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2009 - October 13 - 15 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Server-side scripting when SIP phones register
You should be able to do this either via a system command or an AGI. _ From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Olivier Sent: Thursday, October 08, 2009 9:30 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Server-side scripting when SIP phones register Hi, Some IP Phones (Aastra) are able to send a custom HTTP request just after registration completion. Using this, it is possible to update phone's screen with messages like "Do Not Disturb" or "Forwarded To VM". RFC 3680 (http://www.faqs.org/rfcs/rfc3680.html) provides a mecanism to support these interactions. To my knowledge, this RFC is not implemented yet in Asterisk. Has someone found a workaround to that some scripting could be run whenever a SIP phones registers ? Regards ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Server-side scripting when SIP phones register
Hi, Some IP Phones (Aastra) are able to send a custom HTTP request just after registration completion. Using this, it is possible to update phone's screen with messages like "Do Not Disturb" or "Forwarded To VM". RFC 3680 (http://www.faqs.org/rfcs/rfc3680.html) provides a mecanism to support these interactions. To my knowledge, this RFC is not implemented yet in Asterisk. Has someone found a workaround to that some scripting could be run whenever a SIP phones registers ? Regards ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2009 - October 13 - 15 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users