tags:

views:

40

answers:

1

I have several Snom VoIP phones in the office running off a virtual phone system in London somewhere.

I've written a small PHP app that lets me control the phone remotely - all it does in the background is cURL into my handset's web interface and control it that way.

However now I'd like my PHP app to know what other phones on the system are available/busy. I think the phone handsets do this by way of a SIP subscription with the virtual phone system, whereby my handset subscribes to feeds from all other handsets on the system and can then light/extinguish the busy lamp.

Am I going about this the right way? Is there any way I can have a PHP script subscribe to those notifications?

Many thanks in advance

A: 

This is not likely, but really depends on what you mean by a "PHP app". If it's a standard web-based application, you can't do anything about it. SIP communication is done over UDP sockets and requires you to listen all the time for responses.

If you mean an actual application, running all the time, then you need to implement the SUBSCRIBE/NOTIFY part of SIP spec and it is of course possible.

If you want to pull the statuses of other phones into your web application, I'd recommend setting up a server which will handle the standard SIP communication and subscribe to the phone's presence, then update the information in a local database. In the web app you can simply read the current status from the database and present it to the user.

viraptor