[Freeswitch-users] how to use session:playAndGetDigits with the "say" command in lua script?

Wes wes-fs at 499x.com
Fri Jun 24 23:39:00 MSD 2011


worked great, thank you

On 6/24/2011 11:02 AM, Michael Collins wrote:
> Go look in conf/lang/en/en.xml. Near the top of that file is a place 
> to specify the default TTS engine and TTS voice for your language. Try 
> setting those to "flite" and "kal" or whatever voice you are using.
> -MC
>
> On Fri, Jun 24, 2011 at 8:57 AM, Wes <wes-fs at 499x.com 
> <mailto:wes-fs at 499x.com>> wrote:
>
>     Thanks!... I took a look, and got one working like this:
>
>     <include> <!--This line will be ignored it's here to validate the
>     xml and is optional -->
>     <macro name="press_x_to_continue">
>     <input pattern="^(\d+)$">
>     <match>
>     <action function="play-file" data="voicemail/vm-press.wav"/>
>     <action function="say" data="$1" method="pronounced" type="items"/>
>     <action function="play-file" data="voicemail/vm-continue.wav"/>
>     <action function="speak-text" data="yo, you must press $1 to
>     continue, do it now"/>
>     </match>
>     </input>
>     </macro>
>     </include>
>
>     but when it got to the speak-text function, it gave this error:
>
>     2011-06-24 10:54:40.684627 [ERR] switch_core_speech.c:61 Invalid
>     speech module [cepstral]!
>     2011-06-24 10:54:40.684627 [ERR] switch_ivr_play_say.c:2377
>     Invalid TTS module!
>
>     I have the flite engine active, so how do I configure speak-text
>     to try using the flite engine instead of cepstral?
>
>
>
>     On 6/22/2011 6:42 PM, Michael Collins wrote:
>>     Have you researched the subject of "phrase macros"? That may be
>>     your golden ticket. If you have the FS book then look at the
>>     latter half of ch 6. Otherwise check out these resources:
>>     http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase
>>     conf/lang/en/vm/sounds.xml
>>     conf/lang/en/vm/tts.xml
>>
>>     The voicemail system uses phrase macros a ton, and effectively, I
>>     might add. In short, phrase macros let you piece together sound
>>     prompts, calls to the say app, calls to the speak app, calls to
>>     the sleep app, etc. I think you would be most interested in the
>>     "speak-text" action.
>>
>>     -MC
>>
>>
>>     On Wed, Jun 22, 2011 at 3:09 PM, Wes <wes-fs at 499x.com
>>     <mailto:wes-fs at 499x.com>> wrote:
>>
>>         or maybe we just need a new version of this method called
>>         "speakAndGetDigits" that specifically takes a couple of
>>         string parameters for the words to speak, instead of taking
>>         the location of the wav files...
>>
>>
>>         On 6/22/2011 4:13 PM, Wes wrote:
>>>         Sorry, I was thrown off by the dialplan example... I'm
>>>         trying to use speak... I changed my example to try the speak
>>>         command and I still have the same issue with the quotes.
>>>
>>>         Is it possible to send in a "speak" phrase as the phrase to
>>>         use in the PAGD command?  Or do I have to record a wav file
>>>         and pass the name of the wave file in for that parameter?
>>>
>>>         On 6/22/2011 3:51 PM, Michael Collins wrote:
>>>>         Can you confirm: are you trying to use TTS or the say
>>>>         engine? These are two completely different subjects. If you
>>>>         want to use TTS then you need the "speak" app, not the
>>>>         "say" app:
>>>>         http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_speak
>>>>
>>>>         -MC
>>>>
>>>>         On Wed, Jun 22, 2011 at 12:53 PM, Wes <wes-fs at 499x.com
>>>>         <mailto:wes-fs at 499x.com>> wrote:
>>>>
>>>>             I'm trying to convert an example from a dialplan:
>>>>
>>>>             http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits#Examples
>>>>
>>>>             <extension name="play_and_get_digits with say">
>>>>             <condition field="destination_number"
>>>>             expression="^(6500)$">
>>>>             <action application="play_and_get_digits" data="1 1 1
>>>>             3000 # say:'press one for technical support'
>>>>             silence_stream://250 res \d+" />
>>>>             </condition>
>>>>             </extension>
>>>>
>>>>             into a lua statement like this:
>>>>
>>>>              digits = session:playAndGetDigits(1, 1, 1, 3000, "#",
>>>>             "say:'press one for technicial support'
>>>>             ", "say:'invalid entry'", "\\d+")
>>>>
>>>>             but I'm having trouble with the quoting.  The log says:
>>>>
>>>>             2011-06-22 14:40:52.614654 [ERR]
>>>>             switch_ivr_play_say.c:1144 Invalid Args
>>>>
>>>>             I can't find any lua examples that use both
>>>>             playAndGetDigits and "say"
>>>>
>>>>             any suggestions?
>>>>
>>>>
>>>>             _______________________________________________
>>>>             Join us at ClueCon 2011, Aug 9-11, Chicago
>>>>             http://www.cluecon.com 877-7-4ACLUE
>>>>
>>>>             FreeSWITCH-users mailing list
>>>>             FreeSWITCH-users at lists.freeswitch.org
>>>>             <mailto: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
>>>>
>>>>
>>>>
>>>>         _______________________________________________
>>>>         Join us at ClueCon 2011, Aug 9-11, Chicago
>>>>         http://www.cluecon.com  877-7-4ACLUE
>>>>
>>>>         FreeSWITCH-users mailing list
>>>>         FreeSWITCH-users at lists.freeswitch.org  <mailto: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
>>>
>>>
>>>         _______________________________________________
>>>         Join us at ClueCon 2011, Aug 9-11, Chicago
>>>         http://www.cluecon.com  877-7-4ACLUE
>>>
>>>         FreeSWITCH-users mailing list
>>>         FreeSWITCH-users at lists.freeswitch.org  <mailto: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
>>
>>         _______________________________________________
>>         Join us at ClueCon 2011, Aug 9-11, Chicago
>>         http://www.cluecon.com 877-7-4ACLUE
>>
>>         FreeSWITCH-users mailing list
>>         FreeSWITCH-users at lists.freeswitch.org
>>         <mailto: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
>>
>>
>>
>>     _______________________________________________
>>     Join us at ClueCon 2011, Aug 9-11, Chicago
>>     http://www.cluecon.com  877-7-4ACLUE
>>
>>     FreeSWITCH-users mailing list
>>     FreeSWITCH-users at lists.freeswitch.org  <mailto: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
>
>     _______________________________________________
>     Join us at ClueCon 2011, Aug 9-11, Chicago
>     http://www.cluecon.com 877-7-4ACLUE
>
>     FreeSWITCH-users mailing list
>     FreeSWITCH-users at lists.freeswitch.org
>     <mailto: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
>
>
>
> _______________________________________________
> Join us at ClueCon 2011, Aug 9-11, Chicago
> http://www.cluecon.com 877-7-4ACLUE
>
> 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/20110624/7a12b115/attachment-0001.html 


More information about the FreeSWITCH-users mailing list