[Kamailio-Users] Relaying NOTIFY UDP messages over TCP

Pascal Maugeri pascal.maugeri at gmail.com
Tue Mar 9 13:54:26 CET 2010


Hi

We need to force some NOTIFY messages going through our kamailio instance
over UDP to be sent over TCP.

For that purpose we inserted the following relaying rule at the beginning of
the routing script:

route{

if (!mf_process_maxfwd_header("10")) {
  sl_send_reply("483","Too Many Hops");
  exit;
}


  if(msg:len>1300 && is_method("NOTIFY") && proto==UDP)
  {
        $du = "sip:" + $(ruri{uri.host}) + ":" + $(ruri{uri.port}) +
";transport=tcp";
        t_relay();
        exit;
  }



[...]


This works well if the destination of the NOTIFY message is not behind NAT.

We're looking for a solution for the NAT case. We did some tests using
lookup("location") before changing $du but we did not get any success.

Do you have any idea on how to implement this relaying properly ?

Is it acceptable to change the $du and then execute the t_relay as we did ?

Cheers
Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100309/1535dc1f/attachment.htm>


More information about the sr-users mailing list