Russell Brown
2008-Oct-09 17:38 UTC
[asterisk-users] asterisk-users Digest, Vol 51, Issue 26
Quoth Jared Smith...>On Wed, 2008-10-08 at 18:51 +0100, Russell Brown wrote: >> Can anyone point me at a code fragment (C would be nice) that I could >> use to subscribe to hints on a * box? >> >> I'd like to write a small (hopefuly efficient) widget to show custom >> device states and believe that a subscription to the hint would be the >> most efficient but I'm very open to suggestions. > >Maybe I'm missing something here, but wouldn't it be a whole lot easier >to get this information via the Asterisk Manager Interface, rather than >writing a C program that knows how to parse SIP messages?Yes I could do it through the Manager and a polling loop but wouldn't that be somewhat inefficient? By using the SIP Hints I was hoping that my code would only be told when a hint changed. Any pointers anyone? -- Regards, Russell -------------------------------------------------------------------- | Russell Brown | MAIL: russell at lls.com PHONE: 01780 471800 | | Lady Lodge Systems | WWW Work: http://www.lls.com | | Peterborough, England | WWW Play: http://www.ruffle.me.uk | --------------------------------------------------------------------
Philipp Kempgen
2008-Oct-09 20:06 UTC
[asterisk-users] Sample code fragement for subscribing to hints wanted (was: Re: asterisk-users Digest, Vol 51, Issue 26)
Russell Brown schrieb:> Quoth Jared Smith... >>On Wed, 2008-10-08 at 18:51 +0100, Russell Brown wrote: >>> Can anyone point me at a code fragment (C would be nice) that I could >>> use to subscribe to hints on a * box? >>> >>> I'd like to write a small (hopefuly efficient) widget to show custom >>> device states and believe that a subscription to the hint would be the >>> most efficient but I'm very open to suggestions. >> >>Maybe I'm missing something here, but wouldn't it be a whole lot easier >>to get this information via the Asterisk Manager Interface, rather than >>writing a C program that knows how to parse SIP messages? > > Yes I could do it through the Manager and a polling loop but wouldn't > that be somewhat inefficient? By using the SIP Hints I was hoping that > my code would only be told when a hint changed. > > Any pointers anyone?Same thing with the manager interface. No need to poll (apart from an initial poll after connecting). The manager ifc sends events. ExtensionStatus, NewChannel, Hangup, Link, Unlink. Well, Brian Degenhardt schrieb (on asterisk-dev):> Now that we agree that you have to write a little daemon that connects > to Asterisk, let's explore how that's done. For Switchvox, we've > written just that for our Switchboard: > > http://www.switchvox.com/sv?cmd=screenshots&pic=23 > > Currently this daemon uses the manager interface, which it turns out is > bordering on unusable to do this sort of thing. Don't take my word for > it, ask anyone who's ever tried to track detailed call status over > manager. One of our engineers likened it to digging through your trash > to figure out what you had for dinner, because there isn't a proper way > to just ask.:-) Philipp Kempgen -- http://www.das-asterisk-buch.de - http://www.the-asterisk-book.com Amooma GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 --