<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I&#39;m following the instructions here to create a script the can intercept chat messages: <a href="http://wiki.freeswitch.org/wiki/Mod_sms#send">http://wiki.freeswitch.org/wiki/Mod_sms#send</a><br>when i send a chat message i get the error bellow, why is that? and why the chat method isn&#39;t invoked?<br> <br><br>2014-09-07 13:29:53.397788 [INFO] mod_sms.c:336 Processing text message 1111-&gt;2222 in context public<br>Chatplan: 2222 parsing [public-&gt;public] continue=false<br>Chatplan: 2222@x.x.x.1 Regex (PASS) [public] to(2222@x.x.x.1) =~ /^(.*)$/ break=on-false<br>Chatplan: 2222@x.x.x.1 Action lua(handle_chat.lua) <br>Chatplan: 2222@x.x.x.1 Action reply(Hello, you said: ${_body}) <br>Chatplan: 2222@x.x.x.1 Action send() <br><font size="4"><b>2014-09-07 13:29:53.397788 [ERR] mod_lua.cpp:203 /usr/local/freeswitch/scripts/handle_chat.lua:6: &#39;=&#39; expected near &#39;body&#39;</b></font><br><br></div><div><br><br></div><b><u>Public.xml:</u></b><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;include&gt;<br>    &lt;context name=&quot;public&quot;&gt;<br>        &lt;extension name=&quot;public&quot;&gt;<br>            &lt;condition field=&quot;to&quot; expression=&quot;^(.*)$&quot;&gt;<br>                &lt;action application=&quot;lua&quot; data=&quot;handle_chat.lua&quot;/&gt;<br>                &lt;action application=&quot;reply&quot; data=&quot;Hello, you said: ${_body}&quot;/&gt;<br>                &lt;action application=&quot;send&quot;/&gt;<br>            &lt;/condition&gt;<br>        &lt;/extension&gt;<br>    &lt;/context&gt;<br>&lt;/include&gt;<br><br><br></div><u><b>handle_chat.lua:</b></u><br>logDebug(&quot;handle_chat - start before function&quot;);<br>function chat(message, args)<br>    logDebug(&quot;handle_chat - start in function&quot;);<br>    var body = message:getBody();<br>    logInfo(&quot;chatplan body is=&quot; .. body);<br>--message:chat_execute(&quot;reply&quot;, &quot;you said: &quot; .. message:getBody());<br>    logDebug(&quot;handle_chat - end&quot;);<br>end<br><br><br><br></div>Thanks,<br></div>Snabel<br><div><div><div><br><br><br><br><br><br><br><br><br><br><br><br></div></div></div></div>