<div dir="ltr"><div>Hi Privus,</div><div><br></div><div>This is the script for receiving SMS from gateway, and forward to clients (SIP profile &#39;clients&#39;). The clients already registered in the FS and can make calls. I can confirm that this scripts is executed, but the last event.fire() is look like dont do anything. I checked on the siptrace on.</div>
<div><br></div><div> </div><div>var message_from_user=message.getHeader(&quot;from_user&quot;);</div><div>var message_to_user=message.getHeader(&quot;to_user&quot;);</div><div>var message_body=message.getBody();</div><div>
<br></div><div>console_log(&quot;INFO&quot;, &quot;[receive_inbound_sms]\n&quot;);</div><div>console_log(&quot;INFO&quot;, message.serialize()+&quot;\n&quot;);</div><div>console_log(&quot;INFO&quot;, &quot;message.from_user:&quot;+message_from_user+&quot;\n&quot;);</div>
<div>console_log(&quot;INFO&quot;, &quot;message.to_user:&quot;+message_to_user+&quot;\n&quot;);</div><div>console_log(&quot;INFO&quot;, &quot;message.body:\n&quot;+message_body+&quot;\n&quot;);</div><div><br></div><div>var event = new Event(&quot;CUSTOM&quot;, &quot;SMS:SEND_MESSAGE&quot;);</div>
<div>event.addHeader(&quot;from&quot;, message.getHeader(&quot;from&quot;));</div><div>event.addHeader(&quot;to&quot;, message_to_user);</div><div>event.addHeader(&quot;dest_proto&quot;,&quot;sip&quot;);</div><div>event.addHeader(&quot;sip_profile&quot;,&quot;clients&quot;);</div>
<div>event.addBody(message.getBody());</div><div>console_log(&quot;INFO&quot;, &quot;Relay:\n&quot;+event.serialize()+&quot;\n&quot;);</div><div>event.fire();</div><div><br></div><div>Regards,</div><div><br></div><div>Donny</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 7:58 PM, Privus P <span dir="ltr">&lt;<a href="mailto:privus007@gmail.com" target="_blank">privus007@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"><div><div>Hi Donny,<br><br></div>Perhaps you could share your javascript and lua script so that we could try to figure out together what isn&#39;t working.<br>
</div>Judging by the apparent lack of response to this thread, it seems to be the best way forward to try and resolve this.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 6:50 AM, Donny Hardyanto <span dir="ltr">&lt;<a href="mailto:hardyanto.donny@gmail.com" target="_blank">hardyanto.donny@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"><p dir="ltr">Hi,</p>
<p dir="ltr">I have similar problem. I use gateway to GSM provider that support SIP simple . So far i can send sms from fs to gateway and receive sms in fs from gateway. But I was lost how to send the incoming sms from gateway to client. </p>



<p dir="ltr">Also my client support sip simple also. When the sms from client arrive at fs, i dont know how to forward them to gateway. </p>
<p dir="ltr">I use Javascript heavily and tried to produce the same thing as lua script in javascript but it always fail. The event fire command does not produce any thing. </p>
<p dir="ltr">Can any one show us or point us how to forward sms?</p>
<p dir="ltr">Dinny</p><div><div>
<div class="gmail_quote">On Feb 4, 2014 8:06 PM, &quot;Peter Villeneuve&quot; &lt;<a href="mailto:petervnv1@gmail.com" target="_blank">petervnv1@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr">Hi,<div><br></div><div>Thanks for helping out. Indeed I would love to try out a lua script to handle SMS.</div><div>Can anyone point to a sample script that I can study and play with?</div><div><br></div><div>



Any help is much appreciated. I&#39;m still stuck with SMS hitting FS but not being forwarded to the peer....</div><div><br></div><div>Thanks,</div><div>Peter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">



On Sun, Feb 2, 2014 at 5:46 PM, Privus P <span dir="ltr">&lt;<a href="mailto:privus007@gmail.com" target="_blank">privus007@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"><div><div><div>Hi Peter,<br><br></div>I&#39;m not really sure why your SMS isn&#39;t being routed correctly.<br></div>I&#39;m sure others in this list have a lot more experience and can help you out, but have you thought of using a lua script to handle SMS instead of relying on the send action?<br>




<br></div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Sat, Feb 1, 2014 at 2:00 PM, Peter Villeneuve <span dir="ltr">&lt;<a href="mailto:petervnv1@gmail.com" target="_blank">petervnv1@gmail.com</a>&gt;</span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi,</div><div><br></div><div>I&#39;m experimenting with GSMopen and I&#39;m having trouble doing something which is likely pretty simple.</div>




<div>I have enabled mod_sms and GSMopen in FS. I can send SIP simple messages between 2 registered peers OK.</div>
<div>I can see that incoming GSM SMS messages arrive in FS as expected, but I can&#39;t seem to get them converted into SIP SIMPLE format and routed to the peer (1000).</div><div>Once they arrive in FS, I can see in the log:</div>





<div><br></div><div>2014-01-30 20:00:54.840999 [INFO] mod_sms.c:336 Processing text message +4412398746-&gt;gsm01 in context default</div><div>Chatplan: gsm01 parsing [default-&gt;basic p2p] continue=true</div><div>Chatplan: gsm01 Regex (PASS) [basic p2p] to(gsm01) =~ /^(.*)$/ break=on-false</div>





<div>Chatplan: gsm01 Action send() </div><div><br></div><div><br></div><div>My chatplan has:</div><div><br></div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</div><div>&lt;include&gt;</div><div>  &lt;context name=&quot;default&quot;&gt;</div>





<div><br></div><div>     &lt;extension name=&quot;basic p2p&quot; continue=&quot;true&quot;&gt;</div><div>      &lt;condition field=&quot;to&quot; expression=&quot;^(.*)$&quot;&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;!--<span style="white-space:pre-wrap">        </span>&lt;action application=&quot;lua&quot; data=&quot;test.lua&quot;/&gt; --&gt;</div>





<div><span style="white-space:pre-wrap">        </span>  &lt;action application=&quot;send&quot;/&gt;</div><div>      &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div><br></div><div>  &lt;/context&gt;</div><div>
&lt;/include&gt;</div><div><br></div><div>And in my gsmopen.conf.xml:</div><div><br></div><div>&lt;configuration name=&quot;gsmopen.conf&quot; description=&quot;GSMopen Configuration&quot;&gt;</div><div>  &lt;global_settings&gt;</div>





<div>    &lt;param name=&quot;debug&quot; value=&quot;8&quot;/&gt;</div><div>    &lt;param name=&quot;dialplan&quot; value=&quot;XML&quot;/&gt;</div><div>    &lt;param name=&quot;context&quot; value=&quot;default&quot;/&gt;</div>





<div>    &lt;param name=&quot;hold-music&quot; value=&quot;$${moh_uri}&quot;/&gt;</div><div>    &lt;param name=&quot;destination&quot; value=&quot;1000&quot;/&gt;</div><div>  &lt;/global_settings&gt;</div><div><br></div>




<div>
<br></div><div>I believe I&#39;m doing something wrong in the chatplan. Is there any transfer action like in the regular XML dialplan?</div><div>I tried creating in the default dialplan the following, hoping that it would be similar to sofia calls and transfer the incoming SMS to peer 1000, but no dice.</div>





<div><br></div><div>&lt;include&gt;</div><div>  &lt;extension name=&quot;sms_inbound&quot;&gt;</div><div>    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(gsm01)$&quot;&gt;</div><div>      <span style="white-space:pre-wrap">        </span>&lt;action application=&quot;transfer&quot; data=&quot;1000 XML default&quot;/&gt;</div>





<div>    &lt;/condition&gt;</div><div>  &lt;/extension&gt;</div><div>&lt;/include&gt;</div><div><br></div><div>So, basically, how can I route the incoming SMS to peer 1000?</div><div><br></div><div>Thanks</div></div>
<br></div></div>_________________________________________________________________________<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" target="_blank">http://www.freeswitchsolutions.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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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.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>
<br></blockquote></div><br></div>
<br>_________________________________________________________________________<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" target="_blank">http://www.freeswitchsolutions.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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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.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>
<br></blockquote></div><br></div>
<br>_________________________________________________________________________<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" target="_blank">http://www.freeswitchsolutions.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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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.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>
<br></blockquote></div>
</div></div><br>_________________________________________________________________________<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" target="_blank">http://www.freeswitchsolutions.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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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.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>
<br></blockquote></div><br></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>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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.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>
<br></blockquote></div><br></div>