asterisk-users at rogg.is
2009-Jul-06 00:09 UTC
[asterisk-users] What is the best way to share extension state
Greetings. I wonder what is the best way in your opinion to share real-time extension state with applications outside of asterisk? What I'm after is the best way to have Asterisk update a central repository with the state of each extension configured in the local Asterisk setup. To try and explain what I am trying to achieve, Imagine for example if asterisk would call a url like this: "http://myserver/updatestatus.php?ext=101&state=idle" "http://myserver/updatestatus.php?ext=101&state=ringing" "http://myserver/updatestatus.php?ext=101&state=occupied" for every state change of every extensions. I've already looked closely at a few ways to do this. The closest I've come so far is thinking in this direction: 1) Set up a process that does SIP SUBSCRIBE to read hints from Asterisk extensions. 2) Use jabber integration to somehow achieve this. 3) Hook into the AMI and parse the ExtensionStatusEvent which I think gives me what I want. Possible problems with the things I've considered so far may be for example: o Extensions that are part of a queue (making sure state is reflected even if the ext is ringing as part of a queue ringing). o Making sure the process can recover even if the monitoring entity needs to be restarted. I'm very curious to hear what your take on this is and if this has perhaps been solved elegantly already? Thank you for considering this question and your time spent thinking about this and possibly replying with your thoughts. Sincerely, Baldvin
David Backeberg
2009-Jul-06 03:25 UTC
[asterisk-users] What is the best way to share extension state
On Sun, Jul 5, 2009 at 8:09 PM, <asterisk-users at rogg.is> wrote:> Greetings. > > I wonder what is the best way in your opinion to share real-time extension > state with applications outside of asterisk? > 3) Hook into the AMI and parse the ExtensionStatusEvent which I think gives > me what I want. > > I'm very curious to hear what your take on this is and if this has perhaps > been solved elegantly already? Thank you for considering this question and > your time spent thinking about this and possibly replying with your > thoughts.You may like the cli command 'core show channels concise' which outputs in a convenient CSV-style format.
Benny Amorsen
2009-Jul-06 08:44 UTC
[asterisk-users] What is the best way to share extension state
<asterisk-users at rogg.is> writes:> 3) Hook into the AMI and parse the ExtensionStatusEvent which I think gives > me what I want.This is the "traditional" way, I believe. The challenge with AMI is that it is becoming a high-bandwidth channel. If you're only interested in one event type, you will spend quite a bit of CPU time just discarding uninteresting events. Perhaps it would be possible to make events more granular, instead of just on/off? Apart from that AMI works fine. /Benny
Olivier
2009-Jul-06 12:10 UTC
[asterisk-users] What is the best way to share extension state
2009/7/6 <asterisk-users at rogg.is>> Greetings. > > I wonder what is the best way in your opinion to share real-time extension > state with applications outside of asterisk?What do you exactly mean by "applications" ? Do you mean a single server application or several instances of client applications ?> > > ... > > Sincerely, > Baldvin > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090706/4b6d01f0/attachment.htm