[asterisk-users] Manager API - standardization?
Wesley Haut
wes at wesleyhaut.com
Mon Dec 22 09:04:13 CST 2008
Hi all,
I know I'm probably stirring up a hornet's nest with this question/comment
but I've spent the last few days working on a PHP-based class for the
manager interface as we're preparing for a pretty big upgrade at our call
center and I'm revamping all of the management apps I've written. I can
connect to the manager interface and send query strings back and forth all
day long, but I'm having issues when it comes to parsing the return data.
My issue isn't a PHP one, but rather issues with the consistency of the
Manager interface return values.
For instance, for the built in actions such as Login, SIPPeers, QueueStatus
(the three that I will be calling the most) NONE of those three has a
standard return value. Login doesn't return an Event: LoginComplete flag,
so the login function can't use the generic Action function I've written.
SIPPeers returns an additional line after Event: PeerlistComplete, and
Peerlist != SIPPeers (meaning the action and eventcomplete flags should
match, IMHO).
The way QueueStatus returns data is the ideal, the action flag (QueueStatus)
has a corresponding complete tag (QueueStatusComplete) and I can (fairly)
easily parse the return data by tacking 'Complete' onto the action flag. I
just wanted to see what everyone else though of coming up with a standard
for ALL manager commands so building applications to hook into Asterisk
isn't a crap shoot like it is now.
My initial proposal:
Any $action has a corresponding $actionComplete event (ie SIPPeers would be
SIPPeersComplete instead of PeerlistComplete)
The ActionComplete event is the LAST line for any return
Like I said, I'm sure this will ruffle some feathers and that is not my
intent, maybe I'm missing something here so please (kindlly) inform me if I
am.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081222/d5bdceb2/attachment.htm
More information about the asterisk-users
mailing list