<div dir="ltr">It is just the header string sometimes - what I did is serialize the 'message:serialize()' 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("info", "chat console\n");</div><div><br></div><div> local event = freeswitch.Event("CUSTOM", "SMS::SEND_MESSAGE");</div><div> event:addHeader("proto", "sip");</div><div> event:addHeader("dest_proto", "sip");</div><div> event:addHeader("from", message:getHeader("from"));</div><div> event:addHeader("from_host", 'YOURS');</div><div> event:addHeader("from_full", message:getHeader("from_full"));</div><div><br></div><div> event:addHeader("to", to);<br></div><div> event:addHeader("to_user", 'YOURS' );</div><div> event:addHeader("to_host", 'YOURS');</div><div> event:addHeader("type", message:getHeader("type"))</div></div><div><div> msg = message:getBody()</div><div> if (msg) then</div><div> event:addBody(msg)</div><div> end</div><div>-- freeswitch.consoleLog("info", event:serialize());</div><div>-- freeswitch.consoleLog("info", 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"><<a href="mailto:snabel@lexifone.com" target="_blank">snabel@lexifone.com</a>></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'm using Linphone to test mod_sms on smart phones, the chat messages aren't being forwarded to the second user.<br></div>I've two registered users 3333 and 4444. when i use action "send" the message is forwarded, but when i use my script with event fire it's not...what am i missing? <br><br></div><b><u>public.xml:</u></b><br><br><?xml version="1.0" encoding="utf-8"?><br><include><br> <context name="public"><br> <extension name="public"><br> <condition field="to" expression="^(.*)$"><br> <action application="lua" data="handle_chat.lua"/><br> <action application="reply" data="Hello, you said: ${_body}"/><br> <!--action application="send"/--><br> </condition><br> </extension><br> </context><br></include><br><br><br><b><u>handle_chat.lua</u></b><br><br><div><div>local body = message:getBody();<br>local from = message:getHeader("from");<br>local to = message:getHeader("to");<br>freeswitch.consoleLog("info", message:getHeader("from"));<br>freeswitch.consoleLog("info", message:getHeader("to"));<br>freeswitch.consoleLog("info", message:serialize());<br>freeswitch.consoleLog("info", message:getBody() .. "\n");<br>local event = freeswitch.Event("CUSTOM", "SMS::SEND_MESSAGE");<br>event:addHeader("proto", "sip");<br>event:addHeader("dest_proto", "sip");<br>event:addHeader("from", "sip:" .. from);<br>event:addHeader("from_full", "sip:" .. from);<br>event:addHeader("to", to);<br>event:addHeader("type", "text/html");<br>event:addHeader("replying", "true");<br>event:addBody("Hello from Seven Du! Have funnnnnnn!");<br>freeswitch.consoleLog("info", 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>