Hello Everyone, 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.
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.
route[MESSAGE_FORWARD] { xlog("L_INFO", "Incoming new SMS [$rm] from $tU --> $td\n");
if(fnmatch("$rs", "202") && fnmatch("$rr", "Accepted") && allow_trusted("$si", "$proto")) { $avp(from) = $fu; $avp(to) = $tu; $avp(new_to) = "<" + $avp(to) + ">" + ";messagetype=SMS";
xlog("L_INFO", "Message Accepted by B2BUA --> [$rs] with [$rr] from [$avp(from)] to [$avp(to)]\n");
if(fnmatch("$fU", "offline")) { xlog("L_INFO", "OFFLINE SMS: from [$fU] user --> $fU\n"); $avp(from) = $(avp(to){uri.user}); xlog("L_INFO", "OFFLINE SMS: Searching destination user $avp(oexten)\n"); sql_pvquery("cb", "select contact from location where username = '$avp(from)'","$avp(dst)"); xlog("L_INFO", "OFFLINE SMS: set new destination --> $avp(dst)\n"); $avp(new_to) = "<" + $(avp(dst){tobody.uri}) + ">" + ";messagetype=SMS"; }
$sht(a=>to) = $avp(new_to); xlog("SMS from --> $fU domain $fd\n"); xlog("-------------------------------------\n"); xlog("L_INFO", "FROM --> $avp(from)\n"); xlog("L_INFO", "OLD_TO --> $avp(to)\n"); xlog("L_INFO", "NEW_TO --> $avp(new_to)\n"); }
if(compare_ips("$td", "10.18.130.27")) { xlog("L_INFO", "Message from B2BUA contain domain --> $td . Updating...\n"); $avp(new_dst) = $(hdr(Route){param.value,received}); xlog("L_INFO", "New destination --> $avp(new_dst)\n"); $avp(new_to) = "<" + $avp(new_dst) + ">" + ";messagetype=SMS"; $sht(a=>to) = $avp(new_to); remove_hf("To"); insert_hf("To: $sht(a=>to)\r\n", "To"); $du = $sht(a=>to); } }
From: "Federico Cabiddu" federico.cabiddu@gmail.com To: "sr-users" sr-users@lists.sip-router.org Sent: Tuesday, 15 November, 2016 11:07:44 Subject: Re: [SR-Users] msilo
Hi Slava, if I understand correctly your scenario, 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. Hope this helps.
Cheers,
Federico
On 15 Nov 2016 3:47 pm, "Slava Bendersky" < volga629@skillsearch.ca > wrote:
Hello Daniel, I am not programmer, but I want place request if kaamilio devs can complete it . Thanks
Slava.
From: "Daniel-Constantin Mierla" < miconda@gmail.com > To: "sr-users" < sr-users@lists.sip-router.org > Sent: Tuesday, 15 November, 2016 03:00:19 Subject: Re: [SR-Users] msilo
Hello,
for me it is fine to add a new parameter to m_store() that takes the body content.
Are you asking for more details of how can be done? Cheers, Daniel
On 13/11/16 07:08, Slava Bendersky wrote:
BQ_BEGIN
Hello Everyone, 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)).
Any help thank you.
Slava.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users