Asterisk / AMI / Perform actions based on the status of "Originate" action
Posted on 2013-12-05
I'm brand new to Asterisk. I'm using Asterisk AMI over http, and the "Originate" command to dial and connect two external phone numbers. Is it possible to add some additional logic (to the dialplan?) that would
a) do something when the calls are successfully connected (like make an http call, or log something in a db table)
b) do something else when the calls are NOT connected successfully (Say one of the parties accidentally hung up before the call could even get started).
I know I could repeated "poll" the server and check the events, but that seems inefficent if it could be done at a lower level. From what I've read so far in Asterisk: The Definitve Guide, I think it's possible ... I'm just not sure how yet :)
Any suggestions pointing in the right direction would be greatly appreciated!