Reputation: 931
I'm using Asterisk to route calls. The logic of my application is rather complex, therefore I'm using PHPAGI.
I would like to execute Dial command and track several things:
All I have now is the $agi->exec('Dial', ...) function. The Dial command allows me to specify a macro, that is being called when the callee answers the call. But how can I specify any php callback instead of this? How can I track the answer moment in my phpagi script?
Thank you!
Upvotes: 0
Views: 1121
Reputation: 15247
You can do macro like this
[macro-dial]
exten => s,1,System(/full/path/php_callback_on_answer.php ${ID})
For callback on hangup use h-extension or just parse cdrs in mysql.
You can record in variable time when call started and calculate time before answer.
Upvotes: 1