how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using. $session->setInputCallback('got_press',""); #listen for key presses in the background while($session->ready()) { $session->streamFile("test_break.wav"); if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } } Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not. Thanks in advance for any ideas. -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS. -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using. $session->setInputCallback('got_press',""); #listen for key presses in the background while($session->ready()) { $session->streamFile("test_break.wav"); if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } } Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not. Thanks in advance for any ideas. -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
This is in javascript instead of Perl, but you can get the gist of it where you would call the getDTMFPlaybackStopOnAny function: function GetDTMFStopOnAny(session, type, data, arg) { arg.digits += data.digit; return false; } function getDTMFPlaybackStopOnAny(playbackFile) { var dtmf = new Object(); dtmf.digits = ""; session.flushDigits(); session.streamFile(playbackFile, GetDTMFStopOnAny, dtmf); if(dtmf.digits == "") { session.collectInput(GetDTMFStopOnAny, dtmf, 15000); } var returnDTMF = ReplaceAll(dtmf.digits, "#", ""); return returnDTMF; } -----Original Message----- From: Hector Geraldino [mailto:Hector.Geraldino@ip-soft.net] Sent: Monday, August 08, 2011 1:30 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts ifdigit is pressed You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS. -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using. $session->setInputCallback('got_press',""); #listen for key presses in the background while($session->ready()) { $session->streamFile("test_break.wav"); if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } } Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not. Thanks in advance for any ideas. -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
OK, how do I send a break command? Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using.
$session->setInputCallback('got_press',""); #listen for key presses in the background
while($session->ready()) { $session->streamFile("test_break.wav");
if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } }
Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not.
Thanks in advance for any ideas.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com
Well, I'm not a perl developer so I don't have an accurate response for your question. My guess is that you can call: $session->call_command("break"); But I would recommend you to take a look at the wiki page http://wiki.freeswitch.org/wiki/Mod_perl to see some examples and get a better idea of how to do it. -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 8:36 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed OK, how do I send a break command? Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using.
$session->setInputCallback('got_press',""); #listen for key presses in the background
while($session->ready()) { $session->streamFile("test_break.wav");
if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } }
Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not.
Thanks in advance for any ideas.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Well, I can try that -- I had never used call_command and it seems not to be available in the .pm. I did a search and found sock.pl was using such a thing, so this requires further investigation. Thanks for the tip. Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
Well, I'm not a perl developer so I don't have an accurate response for your question. My guess is that you can call:
$session->call_command("break");
But I would recommend you to take a look at the wiki page http://wiki.freeswitch.org/wiki/Mod_perl to see some examples and get a better idea of how to do it.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 8:36 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
OK, how do I send a break command?
Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using.
$session->setInputCallback('got_press',""); #listen for key presses in the background
while($session->ready()) { $session->streamFile("test_break.wav");
if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } }
Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not.
Thanks in advance for any ideas.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com
There's a session->execute("command") in the perl API as I can see on the wiki. You can try to replace the 'call_command' method name for 'execute' [$session->execute("hangup")] and see if this does the trick. -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Tuesday, August 09, 2011 10:45 AM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed Well, I can try that -- I had never used call_command and it seems not to be available in the .pm. I did a search and found sock.pl was using such a thing, so this requires further investigation. Thanks for the tip. Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
Well, I'm not a perl developer so I don't have an accurate response for your question. My guess is that you can call:
$session->call_command("break");
But I would recommend you to take a look at the wiki page http://wiki.freeswitch.org/wiki/Mod_perl to see some examples and get a better idea of how to do it.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 8:36 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
OK, how do I send a break command?
Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using.
$session->setInputCallback('got_press',""); #listen for key presses in the background
while($session->ready()) { $session->streamFile("test_break.wav");
if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } }
Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not.
Thanks in advance for any ideas.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I don't want to hang up, I just want the file to stop and process the dtmf. Also, I saw something in streamfile where I could process the dtmf while the file was still playing -- maybe I could do rewind and fast forward, if there are calls for that purpose. Thanks for your suggestions. Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
There's a session->execute("command") in the perl API as I can see on the wiki.
You can try to replace the 'call_command' method name for 'execute' [$session->execute("hangup")] and see if this does the trick.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Tuesday, August 09, 2011 10:45 AM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Well, I can try that -- I had never used call_command and it seems not to be available in the .pm.
I did a search and found sock.pl was using such a thing, so this requires further investigation.
Thanks for the tip.
Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
Well, I'm not a perl developer so I don't have an accurate response for your question. My guess is that you can call:
$session->call_command("break");
But I would recommend you to take a look at the wiki page http://wiki.freeswitch.org/wiki/Mod_perl to see some examples and get a better idea of how to do it.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 8:36 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
OK, how do I send a break command?
Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using.
$session->setInputCallback('got_press',""); #listen for key presses in the background
while($session->ready()) { $session->streamFile("test_break.wav");
if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } }
Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not.
Thanks in advance for any ideas.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com
I have found that returning 0 from my inputcallback will do the break -- its not perfect, but about as good as I could get. Now how to do rewind and forward during a stream file as some of them are long. Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
There's a session->execute("command") in the perl API as I can see on the wiki.
You can try to replace the 'call_command' method name for 'execute' [$session->execute("hangup")] and see if this does the trick.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Tuesday, August 09, 2011 10:45 AM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Well, I can try that -- I had never used call_command and it seems not to be available in the .pm.
I did a search and found sock.pl was using such a thing, so this requires further investigation.
Thanks for the tip.
Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
Well, I'm not a perl developer so I don't have an accurate response for your question. My guess is that you can call:
$session->call_command("break");
But I would recommend you to take a look at the wiki page http://wiki.freeswitch.org/wiki/Mod_perl to see some examples and get a better idea of how to do it.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 8:36 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
OK, how do I send a break command?
Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote:
You can send a "break" command in the DTMF callback event. This will stop the audio playback or TTS.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of covici@ccs.covici.com Sent: Monday, August 08, 2011 1:09 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] how to have fs interrupt a file or tts if digit is pressed
Hi. I am using Perl, if that makes any difference and I would like to arrange things in such a way that during a prompt, if the person presses a key, then the prompt will stop speaking and I can see what the key is and do something. Here is an excerpt of the script I am using.
$session->setInputCallback('got_press',""); #listen for key presses in the background
while($session->ready()) { $session->streamFile("test_break.wav");
if ($press_so_far != "") { $session->say($press_so_far,"EN", "NAME_SPELLED", "ITERATED"); $press_so_far=""; } }
Instead of streamFile, I tried speaking text through tts_command line, and a phrase macro which did the same. I was sure that at least streamFile would break, but it did not.
Thanks in advance for any ideas.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com
participants (3)
-
covici@ccs.covici.com
-
Hector Geraldino
-
Jason Moran