Is there a way such that if my script is "speak"ing to a user that they input DTMF and the speak is terminated immediately?
Use speak as part of a phrase in play and get digits :) -Avi On Tue, Jun 19, 2012 at 4:37 PM, Alex <alex@thewinelake.com> wrote:
Is there a way such that if my script is "speak"ing to a user that they input DTMF and the speak is terminated immediately?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
Or send a "break" command after receiving the DTMF event, when using ESL. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, June 19, 2012 9:40 AM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Interrupting "speak" Use speak as part of a phrase in play and get digits :) -Avi On Tue, Jun 19, 2012 at 4:37 PM, Alex <alex@thewinelake.com<mailto:alex@thewinelake.com>> wrote: Is there a way such that if my script is "speak"ing to a user that they input DTMF and the speak is terminated immediately? _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com Join Us At ClueCon - Aug 7-9, 2012 FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto: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
Ooooh, that's interesting! However, I think Avi's right and I'll have to bite the bullet on phrases.... On 19 Jun 2012, at 14:52, Hector Geraldino <Hector.Geraldino@ipsoft.com> wrote:
Or send a “break” command after receiving the DTMF event, when using ESL.
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, June 19, 2012 9:40 AM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Interrupting "speak"
Use speak as part of a phrase in play and get digits :) -Avi
On Tue, Jun 19, 2012 at 4:37 PM, Alex <alex@thewinelake.com> wrote: Is there a way such that if my script is "speak"ing to a user that they input DTMF and the speak is terminated immediately?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
Once you go over the hurdle and finally understand phrases, you should find them very simple and quite powerful and easy to get them to do pretty much whatever you want. As said, they can handle say, speak, pauses, playback all in one place. -Avi On Tue, Jun 19, 2012 at 6:30 PM, Alex Lake <alex@thewinelake.com> wrote:
Ooooh, that's interesting! However, I think Avi's right and I'll have to bite the bullet on phrases....
On 19 Jun 2012, at 14:52, Hector Geraldino <Hector.Geraldino@ipsoft.com> wrote:
Or send a “break” command after receiving the DTMF event, when using ESL.* ***
** **
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Avi Marcus *Sent:* Tuesday, June 19, 2012 9:40 AM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Interrupting "speak"****
** **
Use speak as part of a phrase in play and get digits :) ****
-Avi****
** **
On Tue, Jun 19, 2012 at 4:37 PM, Alex <alex@thewinelake.com> wrote:****
Is there a way such that if my script is "speak"ing to a user that they input DTMF and the speak is terminated immediately?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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****
** **
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
Having got to grips with phrases, I can now see that there is a cheating way to do this, which maybe should be put in the wiki? Essentially, the idea is to have file <freeswitch>/conf/lang/en/simple/simplesay.xml: <include> <macro name="say"> <input pattern="(.*)"> <match> <action function="execute" data="sleep(1000)"/> <action function="speak-text" data="$1"/> </match> </input> </macro> Modify <freeswitch>/conf/lang/en/en.xml to include: <X-PRE-PROCESS cmd="include" data="simple/simplesay.xml"/> If you don't use cepstral, edit the first line to be: <language name="en" say-module="en" sound-prefix="$${sounds_dir}/en/us/callie" tts-engine="flite" tts-voice="kal"> Then in a lua script, you can do something like this: whatToSay = "Hello World, I love FreeSwitch" destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*", "phrase:say:"..whatToSay, "", "\\d+") By the way, is there a fix for Kal talking like a chipmunk?
Having got to grips with phrases, I can now see that there is a cheating way to do this, which maybe should be put in the wiki? Essentially, the idea is to have file <freeswitch>/conf/lang/en/simple/simplesay.xml: <include> <macro name="say"> <input pattern="(.*)"> <match> <action function="execute" data="sleep(1000)"/> <action function="speak-text" data="$1"/> </match> </input> </macro> Modify <freeswitch>/conf/lang/en/en.xml to include: <X-PRE-PROCESS cmd="include" data="simple/simplesay.xml"/> If you don't use cepstral, edit the first line to be: <language name="en" say-module="en" sound-prefix="$${sounds_dir}/en/us/callie" tts-engine="flite" tts-voice="kal"> Then in a lua script, you can do something like this: destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*", "phrase:sa:"..sayWhatFirst, "", "\\d+")
You should probably be using this instead of sleep: <action function="play-file" data="silence_stream://1000"/> This may be FUD, but I recall that sleep could have unintended side-effects because it doesn't provide an RTP stream... while this is playing silence. -Avi On Thu, Jun 21, 2012 at 11:12 AM, Alex <alex@thewinelake.com> wrote:
Having got to grips with phrases, I can now see that there is a cheating way to do this, which maybe should be put in the wiki?
Essentially, the idea is to have file <freeswitch>/conf/lang/en/simple/simplesay.xml:
<include> <macro name="say"> <input pattern="(.*)"> <match> <action function="execute" data="sleep(1000)"/> <action function="speak-text" data="$1"/> </match> </input> </macro>
Modify <freeswitch>/conf/lang/en/en.xml to include:
<X-PRE-PROCESS cmd="include" data="simple/simplesay.xml"/>
If you don't use cepstral, edit the first line to be:
<language name="en" say-module="en" sound-prefix="$${sounds_dir}/en/us/callie" tts-engine="flite" tts-voice="kal">
Then in a lua script, you can do something like this:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*", "phrase:sa:"..sayWhatFirst, "", "\\d+")
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
participants (4)
-
Alex
-
Alex Lake
-
Avi Marcus
-
Hector Geraldino