I’m trying to get my php-agi script to dial the next command if the first one is busy or fail in anyway. The way I set it up now won’t just work, it just return busy and then died, or if it work, it would send two dial commands. Here’s what I got:
$agi->exec('DIAL',"SIP/".$target."@".$ip.",30,g");
$agi->exec('DIAL',"SIP/".$target."@".$ip2.",30,g");
Any kind of help on this is greatly appreciated, thank you in advance!
When you call
Dial()asterisk sets a channel variable called DIALSTATUS.You can read it from your AGI.
Output from “core show application Dial”, from the CLI:
Ex.
So the logic is simply to do the call, only if the first call was not answered.