[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 
<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+")





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