[Asterisk-Dev] Manager multiple results commands
David Pollak
dpp-asterisk at projectsinmotion.com
Mon Apr 4 16:07:47 MST 2005
I've added some functionality to the Manager. Specifically, I've added
the ability to send AGI commands via the Manager API so there's a single
TCP socket open between Asterisk and a controlling application. It
works really well.
One of the things that the MAGI (Manager/AGI) code does is URL Encode
complex responses. If I've got a compound response (e.g., a response
that itself contains another response), I URL encode the contained
response and put it on a line. The controlling application looks for
the line it cares about, and URL Decodes the line.
In the example below, you might have something like:
QueueMember0: name=value&name2=value2&name3=value3
QueueMember1: name=value&name2=value2&name3=value3
This also allows sending non-printables (e.g., a tab, a space, etc.) in
a well defined way.
Sound like it might address some of the needs?
Stefan Reuter wrote:
>On Sat, 2005-04-02 at 13:06 +0200, Peter Svensson wrote:
>
>
>>The separate events used at the moment breaks the command-response
>>pattern. I would prefer of the events mechanism was used only for
>>unsolicited events.
>>
>>
>
>+1
>
>Following a strict command-response pattern would help a lot with
>handling these actions.
>We should have a consistent idea of how these responses look like and
>allow easy mapping to objects.
>The index you proposed seems like a good starting point. Maybe we can
>also add support for different kinds of records (or objects or whatever
>you want to call them) returned. I think of the reponses like the one to
>the QueueStatus action, that contains QueusMembers, QueueParams and
>QueueEntries.
>Currently this is handled by different types of Event that are created
>in response to the action.
>
>A possible syntax for this:
>
> Result: Success
> QueueMember[0].Queue: mainq
> QueueMember[0].Location: Agent/@1
> QueueEntry[0].Queue: mainq
> QueueEntry[0].Position: 1
> QueueEntry[0].Channel: SIP/1310-a18a
> QueueEntry[1].Queue: mainq
> QueueEntry[1].Position: 2
> QueueEntry[1].Channel: SIP/1311-abcd
>
>=Stefan
>
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev
>To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050404/d51175dd/attachment.htm
More information about the asterisk-dev
mailing list