<html><body><div style="font-family: lucida console,sans-serif; font-size: 12pt; color: #000000"><div>Hello Everyone,</div><div>I am trying just forward  MESSAGE through kamailio and I reported issue with mod_sms in freeswitch  https://freeswitch.org/jira/browse/FS-9701. So I was need add work around on kamailio side. The issue that my setup MSILO should work in intercept mode meaning check when user online of offline and act as m_store() or m_dump() without rely on lookup("location");, because registration on B2BUA side.  If m_store() will have additional parameter to store body this will allow check user state and send when need it. </div><div><br data-mce-bogus="1"></div><div>On reply I put something like this to fix To,  as work around  and forward MESSAGE to client, but when client send MESSAGE kamailio receive on public interface and push out of public interface instead RELAY  through local interface and then to B2BUA.</div><div><br data-mce-bogus="1"></div><div>route[MESSAGE_FORWARD] {<br> xlog("L_INFO", "Incoming new SMS [$rm] from $tU --> $td\n");<br><br> if(fnmatch("$rs", "202") && fnmatch("$rr", "Accepted") && allow_trusted("$si", "$proto")) {<br> $avp(from) = $fu;<br> $avp(to) = $tu;<br> $avp(new_to) = "<" + $avp(to) + ">" + ";messagetype=SMS";<br><br> xlog("L_INFO", "Message Accepted by B2BUA --> [$rs] with [$rr] from [$avp(from)] to [$avp(to)]\n");<br><br> if(fnmatch("$fU", "offline")) {<br> xlog("L_INFO", "OFFLINE SMS: from [$fU] user --> $fU\n");<br> $avp(from) = $(avp(to){uri.user});<br> xlog("L_INFO", "OFFLINE SMS: Searching destination user $avp(oexten)\n");<br> sql_pvquery("cb", "select contact from location where username = '$avp(from)'","$avp(dst)");<br> xlog("L_INFO", "OFFLINE SMS: set new destination --> $avp(dst)\n");<br> $avp(new_to) = "<" + $(avp(dst){tobody.uri}) + ">" + ";messagetype=SMS";<br> }<br><br> $sht(a=>to) = $avp(new_to);<br> xlog("SMS from --> $fU domain $fd\n");<br> xlog("-------------------------------------\n");<br> xlog("L_INFO", "FROM --> $avp(from)\n");<br> xlog("L_INFO", "OLD_TO --> $avp(to)\n");<br> xlog("L_INFO", "NEW_TO --> $avp(new_to)\n");<br> }<br><br> if(compare_ips("$td", "10.18.130.27")) {<br> xlog("L_INFO", "Message from B2BUA contain domain --> $td . Updating...\n");<br> $avp(new_dst) = $(hdr(Route){param.value,received});<br> xlog("L_INFO", "New destination --> $avp(new_dst)\n");<br> $avp(new_to) = "<" + $avp(new_dst) + ">" + ";messagetype=SMS";<br> $sht(a=>to) = $avp(new_to);<br> remove_hf("To");<br> insert_hf("To: $sht(a=>to)\r\n", "To");<br> $du = $sht(a=>to);<br> }<br>}</div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Federico Cabiddu" <federico.cabiddu@gmail.com><br><b>To: </b>"sr-users" <sr-users@lists.sip-router.org><br><b>Sent: </b>Tuesday, 15 November, 2016 11:07:44<br><b>Subject: </b>Re: [SR-Users] msilo<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><p dir="ltr">Hi Slava,<br> if I understand correctly your scenario,<br> you could call t_on_failure before relaying the MESSAGE. In this way you should have access to the original message in the failure route triggered after receiving a final reply and you should be able to store it with the regular msilo functions.<br> Hope this helps.</p><p dir="ltr">Cheers,</p><p dir="ltr">Federico</p><div class="gmail_extra"><br><div class="gmail_quote">On 15 Nov 2016 3:47 pm, "Slava Bendersky" <<a href="mailto:volga629@skillsearch.ca" target="_blank" data-mce-href="mailto:volga629@skillsearch.ca">volga629@skillsearch.ca</a>> wrote:<br><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><div style="font-family:lucida console,sans-serif;font-size:12pt;color:#000000" data-mce-style="font-family: lucida console,sans-serif; font-size: 12pt; color: #000000;"><div>Hello Daniel,</div><div>I am not programmer, but I want place request if kaamilio devs can complete it .</div><div>Thanks</div><br><br><div>Slava.</div><br><hr id="m_-2503472498804380182zwchr"><div><b>From: </b>"Daniel-Constantin Mierla" <<a href="mailto:miconda@gmail.com" target="_blank" data-mce-href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br><b>To: </b>"sr-users" <<a href="mailto:sr-users@lists.sip-router.org" target="_blank" data-mce-href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br><b>Sent: </b>Tuesday, 15 November, 2016 03:00:19<br><b>Subject: </b>Re: [SR-Users] msilo<br></div><div class="elided-text"><br><div><p>Hello,</p><p>for me it is fine to add a new parameter to m_store() that takes the body content.</p><p>Are you asking for more details of how can be done?<br></p>Cheers,<br> Daniel<br> <br><div class="m_-2503472498804380182moz-cite-prefix">On 13/11/16 07:08, Slava Bendersky wrote:<br></div><blockquote><div style="font-family:lucida console,sans-serif;font-size:12pt;color:#000000" data-mce-style="font-family: lucida console,sans-serif; font-size: 12pt; color: #000000;"><div>Hello Everyone,</div><div>I asking question/request to add improvement for msilo module where will have ability set $avp(i:body) in mod params.  That will allow use it in m_store() by specifying  body message $avp.  In my case registration is on B2BUA so kamailio pass through/proxy  to destination. In order to check user status online/offline kamailio wait for reply from B2BUA on MESSAGE status if it return error 503 that mean user offline and m_store(0 should store message in db, but the issue that error 503 is in final stage and MESSAGE body is not available any more.  The improvement  will allow specify  body $var in m_store() so new way will be m_store($tu, $avp(body)). </div><br><div>Any help thank you.</div><br><div>Slava.</div></div><br><fieldset class="m_-2503472498804380182mimeAttachmentHeader"></fieldset><br><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="m_-2503472498804380182moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org" target="_blank" data-mce-href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="m_-2503472498804380182moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" data-mce-href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre></blockquote><br><pre class="m_-2503472498804380182moz-signature">-- 
Daniel-Constantin Mierla
<a class="m_-2503472498804380182moz-txt-link-freetext" href="http://twitter.com/#!/miconda" target="_blank" data-mce-href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="m_-2503472498804380182moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda" target="_blank" data-mce-href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - <a class="m_-2503472498804380182moz-txt-link-freetext" href="http://www.asipto.com" target="_blank" data-mce-href="http://www.asipto.com">http://www.asipto.com</a></pre><br>_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br><a href="mailto:sr-users@lists.sip-router.org" target="_blank" data-mce-href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" data-mce-href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br></div></div></div></div><br>_______________________________________________<br> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br> <a href="mailto:sr-users@lists.sip-router.org" target="_blank" data-mce-href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank" data-mce-href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br> <br></blockquote></div><br></div><br>_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>sr-users@lists.sip-router.org<br>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br></div></div></body></html>