Hi team,
I am facing an issue in ami originate command and i am using php ami library support
here the code snippet
$ami = new MyAmi();
$ami = $ami->get_instance(‘IP of the server ‘); // basically connect ami instance
$channelVars = [
‘context’ => ‘test’,
‘priority’ => 1,
‘callerid’ => “833XXXX”,
];
$output = $ami->originate(“9xxxxx@ip”,’’) //
I want if call is dialed on the 9xxxxx and somewhat phone is out of network or switch off
or any other case how can i get the exact response from ami the actual reason of call hangup
plus can i also record the call wile ami dialed the number so that i can listen what is the reason
You can try using AMI action Getvar and the asterisk hangup cause variable, but that variable is only available after the call end, so not sure if this method will work for you. I better suggest you, use Local channel with some kind of curl request, where you can fire hangup cause variable to your PHP script