[asterisk-users] AMI: anything to glue originate to events?

giovanni.v iax at keybits.org
Thu Nov 17 05:00:11 CST 2011


Hi all,
I'm trying to write an application to dialout something then forward the 
call to a context/exten depending on some parameters.

These questions may be trivial, not for me ;-)

---
Action: Originate
Channel: Local/00001 at internal
Exten: 384087
Context: SIP-UA-00128
Priority: 1
CallerID: 601
ActionID: FFA02C6A03

Response: Success
ActionID: FFA02C6A03
Message: Originate successfully queued
---

Ok, the /Response/ is clearly related to the /Originate/ action via 
ActionID, but the next events?

---
Event: Newchannel
Privilege: call,all
Channel: Local/00001 at internal-99fd;1
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
AccountCode:
Exten: 00001
Context: internal
Uniqueid: 1321366075.180

Event: Newchannel
Privilege: call,all
Channel: Local/00001 at internal-99fd;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
AccountCode:
Exten: 00001
Context: internal
Uniqueid: 1321366075.181
---

The only glue I can see here is the first part in the Channel variable 
but what if issuing parallel Originate actions using the same channel?

I will also need to re build the leg between the events raised from my 
Originate action using Channel, Uniqueid, DestUniqueID event values 
which sounds a bit tricky.

Actually the thing is even more complex because the ami connection get 
also events from any other concurrent call in the system.
The task could be easy if it were possible to propagate the action from 
the /Originate/ ActionID (or anything else) to the resulting events but 
unfortunately it is not so.

What am I missing?
Thanks!



More information about the asterisk-users mailing list