[Freeswitch-users] Interrupting "speak"

Avi Marcus avi at avimarcus.net
Thu Jun 21 12:35:35 MSD 2012


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 at 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 at freeswitch.org
> http://www.freeswitchsolutions.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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120621/a7a66a0f/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list