<div dir="ltr">It is just the header string sometimes - what I did is serialize the &#39;message:serialize()&#39; and see all header string and craft them similar in my custom event.<div><br></div><div><br></div><div>With that I got it working see below</div><div><br></div><div><div>freeswitch.consoleLog(&quot;info&quot;, &quot;chat console\n&quot;);</div><div><br></div><div>  local event = freeswitch.Event(&quot;CUSTOM&quot;, &quot;SMS::SEND_MESSAGE&quot;);</div><div>  event:addHeader(&quot;proto&quot;, &quot;sip&quot;);</div><div>  event:addHeader(&quot;dest_proto&quot;, &quot;sip&quot;);</div><div>  event:addHeader(&quot;from&quot;, message:getHeader(&quot;from&quot;));</div><div>  event:addHeader(&quot;from_host&quot;, &#39;YOURS&#39;);</div><div>  event:addHeader(&quot;from_full&quot;, message:getHeader(&quot;from_full&quot;));</div><div><br></div><div>  event:addHeader(&quot;to&quot;, to);<br></div><div>  event:addHeader(&quot;to_user&quot;, &#39;YOURS&#39; );</div><div>  event:addHeader(&quot;to_host&quot;, &#39;YOURS&#39;);</div><div>  event:addHeader(&quot;type&quot;, message:getHeader(&quot;type&quot;))</div></div><div><div> msg = message:getBody()</div><div> if (msg) then</div><div>   event:addBody(msg)</div><div> end</div><div>-- freeswitch.consoleLog(&quot;info&quot;, event:serialize());</div><div>-- freeswitch.consoleLog(&quot;info&quot;, message:serialize());</div><div><br></div><div> event:fire();</div></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 8, 2014 at 6:35 PM, Snabel Kabiya <span dir="ltr">&lt;<a href="mailto:snabel@lexifone.com" target="_blank">snabel@lexifone.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"><div><div><div>Hi,<br><br></div>I&#39;m using Linphone to test mod_sms on smart phones, the chat messages aren&#39;t being forwarded to the second user.<br></div>I&#39;ve two registered users 3333 and 4444. when i use action &quot;send&quot; the message is forwarded, but when i use my script with event fire it&#39;s not...what am i missing?  <br><br></div><b><u>public.xml:</u></b><br><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><b><u>handle_chat.lua</u></b><br><br><div><div>local body = message:getBody();<br>local from = message:getHeader(&quot;from&quot;);<br>local to = message:getHeader(&quot;to&quot;);<br>freeswitch.consoleLog(&quot;info&quot;, message:getHeader(&quot;from&quot;));<br>freeswitch.consoleLog(&quot;info&quot;, message:getHeader(&quot;to&quot;));<br>freeswitch.consoleLog(&quot;info&quot;, message:serialize());<br>freeswitch.consoleLog(&quot;info&quot;, message:getBody() .. &quot;\n&quot;);<br>local event = freeswitch.Event(&quot;CUSTOM&quot;, &quot;SMS::SEND_MESSAGE&quot;);<br>event:addHeader(&quot;proto&quot;, &quot;sip&quot;);<br>event:addHeader(&quot;dest_proto&quot;, &quot;sip&quot;);<br>event:addHeader(&quot;from&quot;, &quot;sip:&quot; .. from);<br>event:addHeader(&quot;from_full&quot;, &quot;sip:&quot; .. from);<br>event:addHeader(&quot;to&quot;, to);<br>event:addHeader(&quot;type&quot;, &quot;text/html&quot;);<br>event:addHeader(&quot;replying&quot;, &quot;true&quot;);<br>event:addBody(&quot;Hello from Seven Du! Have funnnnnnn!&quot;);<br>freeswitch.consoleLog(&quot;info&quot;, event:serialize());<br>event:fire();<br><br><br><div><div><div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks,<br></div><div class="gmail_extra">Snabel<br></div></div></div></div></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Kieu
</div>