[Asterisk-Dev] Manager multiple results commands

Stefan Reuter srt at reucon.net
Sat Apr 2 05:56:13 MST 2005


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




More information about the asterisk-dev mailing list