I want to call multiple numbers and then hangup and then playback sound for the called numbers. I have the code below but the sound is not playing for the called party/s, any help please?
While( condition){ //loop through all numbers to be called
$agi→exec(‘Dial’,“SIP/Trunk/phone”,"",“A”);
$agi→exec(‘Hangup’);
$agi->exec(‘Playback’,"/path/soundfile");
}
Dial does a lot more than dial. It supervises the whole call, so doesn’t exit until the outgoing call ends.
If you want the playback to be asynchronous with respect to the initiator, you probably want to use Originate. However, I would strongly suggest studying the example configurations and getting familiar with simple calls, first.
Thanks for the reply.
I was using php fsockopen() to connect and issue AMI commands with code below but i don’t know how to detect who answered the call. Perhaps if i can know how to detect and record who answered a call?
Is it possible with code above that after playing the soundfile which is working fine, and then send the call to dialplan and save the ${DIALSTATUS} on DB?