Event response (AMI)

Home » Asterisk Users » Event response (AMI)
Asterisk Users 4 Comments

When I execute the Action commands set then the Event would response back.
How would I know which Action are they belong/reference to?

For example:

ACTION: Originate
Channel: SIP/test
Exten: 215
Timeout: 30000
Context: test
Priority: 1
ActionID: 111112222333

Response: Success
ActionID: 111112222333
Message: Originate successfully queued

Event response when I hang up the call:

Event: Hangup
Privilege: call,all
Channel: SIP/test-0000007f
Uniqueid: 1336690030.189

Cause: 16
Cause-txt: Normal Clearing

As you can see, how would I know which which ACTION was that belong to?

If I were coding in PHP (AMI) to Originate the calls then I want to detect
which call hanged up.


4 thoughts on - Event response (AMI)

  • Isn’t that likely to cause race issues if for instance he Originates 30
    calls all at the same time? I would think a better approach would be to
    set a unique channel variable for each originated call and track based on

  • Thanks for the detailed information.

    I have came up with this solution:

    I’ve generate random CALLID and assign to UserEvent()

    exten => xxx,1,UserEvent(CallStatus,UniqueID: ${UNIQUEID}, CallID:

    I then find matching CALLID from the EVENT response which will also tell me
    what the UniqueID.

    What do you think of this solution?