Playback interruption in Asterisk

General discussions about Asterisk.

Moderators: Moderator, Support

Playback interruption in Asterisk

Postby shruthi_deepak » Tue Nov 29, 2011 8:30 am

Hi,
We have different voice menus in our application,we are using php scripting.Wanted to know how the playback of these menus can be interrupted by pressing the DTMF keys?
For eg:we have a voice menu which asks the user to enter his Date of Birth.The user must be able to enter his date of birth even in between when the menu is being played.How to do that?

I saw in Dial plan there is an application called as Background application,which does this work.Is it possible to use Background application in our PHP scripts? Or is there any other method to do this?Please advice
shruthi_deepak
Newsterisk
 
Posts: 9
Joined: Tue Nov 29, 2011 6:24 am

Re: Playback interruption in Asterisk

Postby navaismo » Tue Nov 29, 2011 10:46 am

If you are using PHPAGI you can use get_data(): "array, get_data (string $filename, [integer $timeout = NULL], [integer $max_digits = NULL])"
navaismo
Astmaster
 
Posts: 774
Joined: Mon Dec 07, 2009 1:30 pm
Location: Mexico City, Mexico

Re: Playback interruption in Asterisk

Postby shruthi_deepak » Wed Nov 30, 2011 12:25 am

HI,
We are currently using get data only.We are using as below

$res = $agi->stream_file($voice_menus.'/anyblog_id');fflush($agi->out); // Voice menu which asks for a 4 digit id to be entered

$result = $agi->get_data('beep',8000,4); // Get data gets the 4 digit id after the beep.

But the get data takes the data after the playback is finished,Here in this case the playback cannot be interrupted.
I want to get the data during the playback of the voice menu only.
How to do this?
shruthi_deepak
Newsterisk
 
Posts: 9
Joined: Tue Nov 29, 2011 6:24 am

Re: Playback interruption in Asterisk

Postby navaismo » Wed Nov 30, 2011 11:16 am

in you get_data instead of playing a beep, play the desired file.
navaismo
Astmaster
 
Posts: 774
Joined: Mon Dec 07, 2009 1:30 pm
Location: Mexico City, Mexico

Re: Playback interruption in Asterisk

Postby shruthi_deepak » Thu Dec 01, 2011 12:57 am

Thank you very much.Its working.
shruthi_deepak
Newsterisk
 
Posts: 9
Joined: Tue Nov 29, 2011 6:24 am


Return to Asterisk General

Who is online

Users browsing this forum: No registered users and 3 guests