Hi there,
I revived our crappy phone music player idea again.
As recommended by ambiorixg12 in this thread, I switched over to ControlPlayback.
This works fine, I converted the files into WAV/PCM.
I didn’t know how to read all the music files in Asterisk itself so I’m still using a Perl script.
Is it possbile to wait for and react to other DTMF inputs than supplied by ControlPlayback?
My idea is to also listen for volume change and song skip etc.
First idea was by using wait_for_digit, but unfortunately it seems that my AGI request is waiting for finishing playback.
sub PlayRandomSong
{
$randomFile = RandomSongPath();
# Play song and set control; scheme: skipms,ff,rew,stop,pause,restart
$AGI->exec('ControlPlayback',"$randomFile,5000,9,7,0,5,*");
# TEST volume control:
my $input = $AGI->wait_for_digit(-1);
if ($input == 2)
{
$AGI->exec('Set','VOLUME(TX)=' . $volume + 1);
}
elsif ($input == 8)
{
$AGI->exec('Set','VOLUME(TX)=' . $volume - 1);
}
}
My extensions.conf:
[line1]
exten => raspbx2020,1,Answer()
same => n,Set(VOLUME(TX)=3)
same => n,AGI(/var/lib/asterisk/playback/pbxaudiobackend.pl)
;same => n,Hangup()
Is there a possbilitiy to wait for a special DTMF input while playing a file?
Thanks,
Nico