<div dir="ltr"><div>Sigh...</div><div><br></div><div><br></div><div>Need to confirm if this SpeechRecognition.jm script needs to be migrated to XML handling based on this note:</div><div><br></div><div>&quot;<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px">The new V8 module relies on XML support built into FS, since Google V8 doesn&#39;t have this built-in like Spidermonkey.&quot;</span></div><div><a href="https://freeswitch.org/confluence/display/FREESWITCH/JavaScript+example+-+XML">https://freeswitch.org/confluence/display/FREESWITCH/JavaScript+example+-+XML</a><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px"><br></span></div><div><a href="http://stackoverflow.com/questions/38846047/freeswitch-speech-recognition-speechtools-jm-error?rq=1">http://stackoverflow.com/questions/38846047/freeswitch-speech-recognition-speechtools-jm-error?rq=1</a><br></div><div><br></div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px">Seems to be that handling XML</span></div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">&lt;result grammar=&quot;pizza_order&quot;&gt; </span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">  &lt;interpretation grammar=&quot;pizza_order&quot; confidence=&quot;100&quot;&gt; </span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">    &lt;input mode=&quot;speech&quot;&gt;pickup&lt;/input&gt; </span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">  &lt;/interpretation&gt; </span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">&lt;/result&gt;</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><br></span></div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">Require use of XML - use(&#39;XML&#39;); as i</span><span style="background-color:rgb(245,245,245);color:rgb(51,51,51);font-size:14px">s not parsed by default, and original .jm file may not work just using the original code.</span></div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><br></span></div><div>Thanks</div><div><br></div><div>-Gonzalo</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 10:10 PM, Артур <span dir="ltr">&lt;<a href="mailto:findmeinwland@gmail.com" target="_blank">findmeinwland@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    You can debug it by yourself, print to console different values.
    Explore the code.<br>
    <br>
    <br>
    <div class="m_5723874325292834714moz-cite-prefix">11.01.2017 11:07, Gonzalo Gasca Meza
      пишет:<br>
    </div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">I renamed<span> @confidence
          to confidence helped solving this specific issue but still
          getting errors when reading result.interpretation.</span>
        <div><span><br>
          </span></div>
        <div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">2017-01-11 00:52:52.739773 [DEBUG]
              mod_pocketsphinx.c:464 Recognized: takeout, Confidence:
              99, Confidence-Threshold: 0</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">2017-01-11 00:52:52.759764 [DEBUG]
              SpeechTools.jm:188 ----XML:</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif"><br>
            </font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">&lt;result
              grammar=&quot;pizza_order&quot;&gt;</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">  &lt;interpretation
              grammar=&quot;pizza_order&quot; confidence=&quot;99&quot;&gt;</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">    &lt;input
              mode=&quot;speech&quot;&gt;takeout&lt;/input&gt;</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">  &lt;/interpretation&gt;</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">&lt;/result&gt;</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif"><br>
            </font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">2017-01-11 00:52:52.759764 [CRIT]
              SpeechTools.jm:214 ----ERROR:</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">TypeError: Cannot read property
              &#39;interpretation&#39; of undefined</font></div>
          <div><font color="#242729" face="arial, helvetica neue,
              helvetica, sans-serif">2017-01-11 00:52:55.559759 [NOTICE]
              sofia.c:1011 Hangup sofia/external/<a href="mailto:14088053951@104.236.190.206" target="_blank">14088053951@<wbr>104.236.190.206</a>
              [CS_EXECUTE] [NORMAL_CLEARING]</font></div>
        </div>
        <div><font color="#242729" face="arial, helvetica neue,
            helvetica, sans-serif"><br>
          </font></div>
        <div><font color="#242729" face="arial, helvetica neue,
            helvetica, sans-serif"><br>
          </font></div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Jan 10, 2017 at 12:37 AM,
          Gonzalo Gasca Meza <span dir="ltr">&lt;<a href="mailto:gascagonzalo@gmail.com" target="_blank">gascagonzalo@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Code is from sample Grammar provided by Wiki,
              not my original code...</div>
            <div class="m_5723874325292834714HOEnZb">
              <div class="m_5723874325292834714h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Tue, Jan 10, 2017 at 12:32
                    AM, Артур <span dir="ltr">&lt;<a href="mailto:findmeinwland@gmail.com" target="_blank">findmeinwland@gmail.com</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">But
                      it&#39;s a syntax error, no? I think you need to
                      verify your code<br>
                      <br>
                      <br>
                      10.01.2017 13:26, Gonzalo Gasca Meza пишет:<br>
                      <div class="m_5723874325292834714m_4723325926794957998HOEnZb">
                        <div class="m_5723874325292834714m_4723325926794957998h5">&gt; Hi
                          all,<br>
                          &gt;<br>
                          &gt; I&#39;m trying to install Speech Recognition
                          engine.<br>
                          &gt;<br>
                          &gt; Version: FreeSWITCH (Version 1.6.13
                          -21-e755b43 64bit)<br>
                          &gt;<br>
                          &gt; Following this example:<br>
                          &gt;<br>
                          &gt; <a href="https://wiki.freeswitch.org/wiki/Mod_pocketsphinx" rel="noreferrer" target="_blank">https://wiki.freeswitch.org/wi<wbr>ki/Mod_pocketsphinx</a><br>
                          &gt;<br>
                          &gt; &lt;include&gt;<br>
                          &gt;     &lt;extension name=&quot;pizza_demo&quot;&gt;<br>
                          &gt;       &lt;condition
                          field=&quot;destination_number&quot;
                          expression=&quot;^(pizza|74992)$&quot;/&gt;<br>
                          &gt;       &lt;condition
                          field=&quot;${module_exists(mod_v8)<wbr>}&quot;
                          expression=&quot;true&quot;/&gt;<br>
                          &gt;       &lt;condition
                          field=&quot;${module_exists(mod_poc<wbr>ketsphinx)}&quot;<br>
                          &gt; expression=&quot;true&quot;&gt;<br>
                          &gt;        &lt;action
                          application=&quot;javascript&quot;
                          data=&quot;ps_pizza.js&quot;/&gt;<br>
                          &gt;       &lt;/condition&gt;<br>
                          &gt;     &lt;/extension&gt;<br>
                          &gt; &lt;/include&gt;<br>
                          &gt;<br>
                          &gt; I&#39;m replacing mod_spidermonkey with
                          mod_v8 based on this document and<br>
                          &gt; when I call this number I get:<br>
                          &gt;<br>
                          &gt; EXECUTE sofia/external/<a href="mailto:14088053951@104.236.190.206" target="_blank">14088053951@104<wbr>.236.190.206</a><br>
                          &gt; javascript(ps_pizza.js)<br>
                          &gt; 2017-01-10 03:04:39.099748 [ERR]
                          SpeechTools.jm:191 Exception:<br>
                          &gt; SyntaxError: Unexpected identifier (near:
                          &quot;                                   if<br>
                          &gt; (result.interpretation.@confid<wbr>ence
                          &gt;= grammar_object.min_score) {&quot;)<br>
                          &gt;<br>
                          &gt; If I change:
                          result.interpretation.@confide<wbr>nce to<br>
                          &gt; result.interpretation.[&#39;@confi<wbr>dence&#39;]<br>
                          &gt;<br>
                          &gt; EXECUTE sofia/external/<a href="mailto:14088053951@104.236.190.206" target="_blank">14088053951@104<wbr>.236.190.206</a><br>
                          &gt; export(RFC2822_DATE=Tue, 10 Jan 2017
                          03:13:10 -0500)<br>
                          &gt; 2017-01-10 03:13:10.139816 [DEBUG]
                          switch_channel.c:1296 EXPORT<br>
                          &gt; (export_vars) [RFC2822_DATE]=[Tue, 10 Jan
                          2017 03:13:10 -0500]<br>
                          &gt; EXECUTE sofia/external/<a href="mailto:14088053951@104.236.190.206" target="_blank">14088053951@104<wbr>.236.190.206</a><br>
                          &gt; javascript(ps_pizza.js)<br>
                          &gt; 2017-01-10 03:13:10.159763 [ERR]
                          SpeechTools.jm:191 Exception:<br>
                          &gt; SyntaxError: Unexpected string (near: &quot; 
                                                               if<br>
                          &gt; (result.interpretation.[&#39;@conf<wbr>idence&#39;]
                          &gt;= grammar_object.min_score) {&quot;)<br>
                          &gt;<br>
                          &gt; SpeechTools.jm from:<br>
                          &gt; <a href="https://raw.githubusercontent.com/lordnull/FreeSWITCH/master/scripts/javascript/js_modules/SpeechTools.jm" rel="noreferrer" target="_blank">https://raw.githubusercontent.<wbr>com/lordnull/FreeSWITCH/master<wbr>/scripts/javascript/js_modules<wbr>/SpeechTools.jm</a><br>
                          &gt;<br>
                          &gt; Similar discussion:<br>
                          &gt; <a href="http://lists.freeswitch.org/pipermail/freeswitch-users/2014-June/105818.html" rel="noreferrer" target="_blank">http://lists.freeswitch.org/pi<wbr>permail/freeswitch-users/2014-<wbr>June/105818.html</a><br>
                          &gt;<br>
                          &gt; Any pointers?<br>
                          &gt; I get the mod_v8 module compiled from
                          Freeswitch using this:<br>
                          &gt; <a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_v8" rel="noreferrer" target="_blank">https://freeswitch.org/conflue<wbr>nce/display/FREESWITCH/mod_v8</a><br>
                          &gt;<br>
                          &gt; Thanks<br>
                          &gt;<br>
                          &gt;<br>
                          &gt;<br>
                          &gt;<br>
                          &gt; ______________________________<wbr>______________________________<wbr>_____________<br>
                          &gt; Professional FreeSWITCH Consulting
                          Services:<br>
                          &gt; <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
                          &gt; <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions<wbr>.com</a><br>
                          &gt;<br>
                          &gt; Official FreeSWITCH Sites<br>
                          &gt; <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
                          &gt; <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.o<wbr>rg</a><br>
                          &gt; <a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
                          &gt;<br>
                          &gt; FreeSWITCH-users mailing list<br>
                          &gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a><br>
                          &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a><br>
                          &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/free<wbr>switch-users</a><br>
                          &gt; <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
                          <br>
                          <br>
                          ______________________________<wbr>______________________________<wbr>_____________<br>
                          Professional FreeSWITCH Consulting Services:<br>
                          <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
                          <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions<wbr>.com</a><br>
                          <br>
                          Official FreeSWITCH Sites<br>
                          <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
                          <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.o<wbr>rg</a><br>
                          <a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
                          <br>
                          FreeSWITCH-users mailing list<br>
                          <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a><br>
                          <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a><br>
                          UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/free<wbr>switch-users</a><br>
                          <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a></div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="m_5723874325292834714mimeAttachmentHeader"></fieldset>
      <br>
      <pre>______________________________<wbr>______________________________<wbr>_____________
Professional FreeSWITCH Consulting Services: 
<a class="m_5723874325292834714moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a class="m_5723874325292834714moz-txt-link-freetext" href="http://www.freeswitchsolutions.com" target="_blank">http://www.<wbr>freeswitchsolutions.com</a>

Official FreeSWITCH Sites
<a class="m_5723874325292834714moz-txt-link-freetext" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a class="m_5723874325292834714moz-txt-link-freetext" href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.<wbr>org</a>
<a class="m_5723874325292834714moz-txt-link-freetext" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="m_5723874325292834714moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.<wbr>freeswitch.org</a>
<a class="m_5723874325292834714moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a>
UNSUBSCRIBE:<a class="m_5723874325292834714moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a>
<a class="m_5723874325292834714moz-txt-link-freetext" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></pre>
    </blockquote>
    <br>
  </div></div></div>

<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>