Event response (AMI)

Home » Asterisk Users » Event response (AMI)
Asterisk Users No 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
CallerIDNum:
CallerIDName:

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.

Thanks