Hi<div><br></div><div>We need to force some NOTIFY messages going through our kamailio instance over UDP to be sent over TCP.</div><div><br></div><div>For that purpose we inserted the following relaying rule at the beginning of the routing script:</div>

<div><br></div><div><div>route{</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>if (!mf_process_maxfwd_header(&quot;10&quot;)) {</div>

</div><div><div>  sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);</div></div><div><div>  exit;</div></div><div><div>}</div></div></blockquote><div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div><div>  if(msg:len&gt;1300 &amp;&amp; is_method(&quot;NOTIFY&quot;) &amp;&amp; proto==UDP)</div></div><div><div>  {</div></div><div><div>        $du = &quot;sip:&quot; + $(ruri{uri.host}) + &quot;:&quot; + $(ruri{uri.port}) + &quot;;transport=tcp&quot;;</div>

</div><div><div>        t_relay();</div></div><div><div>        exit;</div></div><div><div>  }</div></div></blockquote><div><div> </div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div>[...]</div></blockquote><div><br></div><div>This works well if the destination of the NOTIFY message is not behind NAT. </div><div><br></div><div>We&#39;re looking for a solution for the NAT case. We did some tests using lookup(&quot;location&quot;) before changing $du but we did not get any success.</div>

<div><br></div><div>Do you have any idea on how to implement this relaying properly ?</div><div><br></div><div>Is it acceptable to change the $du and then execute the t_relay as we did ?</div><div><br></div><div>Cheers</div>

<div>Pascal</div>