[Freeswitch-users] Interrupting "speak"

Alex alex at thewinelake.com
Thu Jun 21 12:12:49 MSD 2012

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 

   <macro name="say">
     <input pattern="(.*)">
         <action function="execute" data="sleep(1000)"/>
         <action function="speak-text" data="$1"/>

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" 

Then in a lua script, you can do something like this:

destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*", 
"phrase:sa:"..sayWhatFirst, "", "\\d+")

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