Checking phones state in PBX.
Checking phones state in PBX.
Hi Everyone, I'm new and I need to achieve one task, but I'm bit confused with so many possibilities in Sip Sorcery so I need a bit help.
I need to "connect" to PBX and ask PBX what numbers he has registered and have information every time when there is new call to one of registered numbers and every time when there is disconnect, and when phone which was registered is now unregistered/broken. I know the sip standard only in the basic degree, but I've heard that sip supports such a information exchange.
Please give me at least list of steps which I need to do, to achieve that
I need to "connect" to PBX and ask PBX what numbers he has registered and have information every time when there is new call to one of registered numbers and every time when there is disconnect, and when phone which was registered is now unregistered/broken. I know the sip standard only in the basic degree, but I've heard that sip supports such a information exchange.
Please give me at least list of steps which I need to do, to achieve that
Re: Checking phones state in PBX.
Assuming it's SIP PBX you can get a list of contacts registered to a specific SIP account by sending a REGISTER request. The response to a REGISTER request should include a list of all the current bindings, for more info see https://tools.ietf.org/html/rfc3261#section-10.3. Note that most likely the REGISTER request would have to be authenticated so that would mean you'd need the password for every SIP account you wanted to check the status on.
There are also the SIP events with which you can subscribe to certain events and receive NOTIFY requests when they occur. Support for SIP events is patchy.
There are also the SIP events with which you can subscribe to certain events and receive NOTIFY requests when they occur. Support for SIP events is patchy.
Re: Checking phones state in PBX.
Sorry for late response, but I thought that I won't have answer so I stopped checking. Currently this task was delayed in my company, so I don't have it implemented yet, and I'm still looking for the answer. In meanwhile I have read some RFC and I decided that it should be the second thing about which you write - sip events. More precisely, I need to subscribe not presence events, about which I have read in RFC, but somehow events about call flow. How can I subscribe to such events using sip sorcery?
Re: Checking phones state in PBX.
You subscribe the same way as with other SIP servers which requires a SUBSCRIBE request be sent to the sipsorcery server.tomhanks wrote:How can I subscribe to such events using sip sorcery?
Re: Checking phones state in PBX.
Aaron, are you referring to the option for polling the server with keep alive packets?
e.g. Notify, Subscribe, etc?
@TomHanks it will be in your ATA or softphone. Often people set this to Auto which is not always beneficial.
What device are you using? e.g. multi-FXS gateway? ATA? or... ?
e.g. Notify, Subscribe, etc?
@TomHanks it will be in your ATA or softphone. Often people set this to Auto which is not always beneficial.
What device are you using? e.g. multi-FXS gateway? ATA? or... ?
tomhanks wrote:Sorry for late response, but I thought that I won't have answer so I stopped checking. Currently this task was delayed in my company, so I don't have it implemented yet, and I'm still looking for the answer. In meanwhile I have read some RFC and I decided that it should be the second thing about which you write - sip events. More precisely, I need to subscribe not presence events, about which I have read in RFC, but somehow events about call flow. How can I subscribe to such events using sip sorcery?
ISP: Southern Phone ADSL2+ $55 Bundle. 22.4/1.2Mbps, ∞GB Bundle [Telstra].
VSP: SIPTalk¹, Symbio² & MyNetFone³ via SIPSorcery Cloud PBX. [Warning! Avoid DIDLogic!!! Beware!!]
H/W: Asus RT-AC86U; Cisco SPA232D, 2 x SPA901's, SPA3102; Yealink SIP-T46G.
VSP: SIPTalk¹, Symbio² & MyNetFone³ via SIPSorcery Cloud PBX. [Warning! Avoid DIDLogic!!! Beware!!]
H/W: Asus RT-AC86U; Cisco SPA232D, 2 x SPA901's, SPA3102; Yealink SIP-T46G.
Re: Checking phones state in PBX.
No. Keep-alives are used to keep NAT connections open rather than subscribing for SIP events. It is true that some SIP user agents send NOTIFY requests as a keep-alive mechanism but in that case they are not strictly part of SIP event subscription.Flip wrote:Aaron, are you referring to the option for polling the server with keep alive packets?
e.g. Notify, Subscribe, etc?
To correctly set up a SIP subscription it must be initiated with a SIP SUBSCRIBE request and then NOTIFY requests can be set to the subscriber for the desired events.
Re: Checking phones state in PBX.
Architecture is simple - people with hardphones (for example polycom/grandstream/yealink) registered to PBX (say Asterisk) and the application which see phones states (talking/finished call/registered/not registered etc.).@TomHanks it will be in your ATA or softphone. Often people set this to Auto which is not always beneficial.
What device are you using? e.g. multi-FXS gateway? ATA? or... ?
I know that phone or PBX may be configured not to allow to share these information, but this is not a problem, we have devices and PBX configured to share everything.@TomHanks it will be in your ATA or softphone. Often people set this to Auto which is not always beneficial.
What device are you using? e.g. multi-FXS gateway? ATA? or... ?
I have tested some simple application which has ability to subscribe and notify, and it worked well, I had to register that application in my PBX, I had to subscribe to my hard phone on my desk, but that simple application was able only to notify with PRESENCE event, so every time when new call appeared, or was disconnected I saw presence event, but I didn't now what kind of activity was that.
Now I need to write same thing in C# and I chose SipSorcery to that, but with ability not only to see presence event, but to now exactly what happend in that phone. Actually that task in my company keeps being postponed, so I still didn't start to write code, but in free time I read about achieving that with SIP.