Generic Manager API Client Apps (was: Re: [asterisk-dev] Another
bounty - app_reload)
Matthew Rubenstein
email at mattruby.com
Thu Oct 5 07:18:26 MST 2006
On Thu, 2006-10-05 at 09:00 -0500, Moises Silva wrote:
> > Actually, what seems missing from the diaplan apps is one that just
> > writes to the Manager API socket any passed string, and one to read from
> > the Manager API socket any sent data.
> app_event should be enough for your needs of writting to the manager socket
>
> http://www.pbxfreeware.org/archives/2005/06/new_download_--_3.html
That app doc is a little confusing: I guess it sends *actions* to
Asterisk, not "events" - events are internal state changes inside
Asterisk which the Manager notifies to clients connected to its API
socket. "Actions" are messages into Asterisk's Manager API socket that
change Asterisk's state. But it does seem to do what I want (if it
works ;).
> Just need something else to read from? But, could you show me some use
> for it, im missing that :(
app_event calls don't seem to return the response from Asterisk after
app_event sends the action message. Not even whether the message was
successfully received by Asterisk. And many actions have asynchronous
results inside Asterisk, eventually indicated only when Asterisk reports
an event. Some state info cannot be polled, and some polling actions
seem to be broken. "ExtensionState" seems broken when an AGI (not a
channel) is mapped to an extension, returning only -1 without a dialplan
hint, and 4 with a hint. The only way to determine ExtensionState is by
subscribing (connecting to, and reading from, the Manager API socket)
for events, which can at least show when an extension becomes busy
(though not when it becomes available again, another apparent Asterisk
bug). Even if I'm just using ExtensionState wrong (not configuring the
AGI right, or failing to make the AGI somehow register its state), the
general case of using the detailed events reported by the Manager API
seems missing. Unless you've got another app that does do this, in which
case I stand happily educated :).
> Thanks
>
> Moises Silva
--
(C) Matthew Rubenstein
More information about the asterisk-dev
mailing list