1
votes

I have been searching around but I can't seem to find the answer. I want to see if what I want to do is possible:

I want to playback music on hold to my caller when my phpagi script is executed. Is there anyway I can grab any DTMF that is being pressed during the musiconhold? I want the music to play continuously....

Any kind of insight I can get on this is greatly appreciated.

2

2 Answers

1
votes

You can use $AGI->stream_file($filename, $digits) (voip-info)

or something like:

while ($digit ne "0") {
     $digit = $AGI->get_data("path/to/your/file", 1, 1);
     do your staff
     ...
}

I used it in Perl, but probably same thing for phpagi. Hope it helps :)

0
votes

I think it's too late to answer but this may help someone. Background music will keep on playing until you stop it.

// start background music
$agi->set_music(true);

//code....do your stuff

// stop background music
$agi->set_music(false);