[Freeswitch-users] Speech recognition SpeechTools.jm Error

Gonzalo Gasca Meza gonzalo at parzee.com
Tue Jan 10 11:26:01 MSK 2017


Hi all,

I'm trying to install Speech Recognition engine.

Version: FreeSWITCH (Version 1.6.13 -21-e755b43 64bit)

Following this example:

https://wiki.freeswitch.org/wiki/Mod_pocketsphinx

<include>
   <extension name="pizza_demo">
     <condition field="destination_number" expression="^(pizza|74992)$"/>
     <condition field="${module_exists(mod_v8)}" expression="true"/>
     <condition field="${module_exists(mod_pocketsphinx)}" 
expression="true">
      <action application="javascript" data="ps_pizza.js"/>
     </condition>
   </extension>
</include>

I'm replacing mod_spidermonkey with mod_v8 based on this document and 
when I call this number I get:

EXECUTE sofia/external/14088053951 at 104.236.190.206 
javascript(ps_pizza.js)
2017-01-10 03:04:39.099748 [ERR] SpeechTools.jm:191 Exception: 
SyntaxError: Unexpected identifier (near: "					if 
(result.interpretation. at confidence >= grammar_object.min_score) {")

If I change: result.interpretation. at confidence to 
result.interpretation.['@confidence']

EXECUTE sofia/external/14088053951 at 104.236.190.206 
export(RFC2822_DATE=Tue, 10 Jan 2017 03:13:10 -0500)
2017-01-10 03:13:10.139816 [DEBUG] switch_channel.c:1296 EXPORT 
(export_vars) [RFC2822_DATE]=[Tue, 10 Jan 2017 03:13:10 -0500]
EXECUTE sofia/external/14088053951 at 104.236.190.206 
javascript(ps_pizza.js)
2017-01-10 03:13:10.159763 [ERR] SpeechTools.jm:191 Exception: 
SyntaxError: Unexpected string (near: "					if 
(result.interpretation.['@confidence'] >= grammar_object.min_score) {")

SpeechTools.jm from:
https://raw.githubusercontent.com/lordnull/FreeSWITCH/master/scripts/javascript/js_modules/SpeechTools.jm

Similar discussion:
http://lists.freeswitch.org/pipermail/freeswitch-users/2014-June/105818.html

Any pointers?
I get the mod_v8 module compiled from Freeswitch using this: 
https://freeswitch.org/confluence/display/FREESWITCH/mod_v8

Thanks






Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list