[asterisk-users] Server-side scripting when SIP phones register

Elliot Otchet elliot.otchet at callingcircles.com
Thu Oct 8 11:44:45 CDT 2009


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/XXXX
PeerStatus: Registered

The SIPpeers request will give you entries that look like this:
Event: PeerEntry
Channeltype: SIP
ObjectName: XXXX
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/XXXX
PeerStatus: Unregistered
Cause: Expired

Quickly followed by:
Event: PeerStatus
Privilege: system,all
Peer: SIP/XXXX
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-bounces at lists.digium.com [mailto:asterisk-users-bounces at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091008/35bfa8cd/attachment.htm 


More information about the asterisk-users mailing list