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("10")) {</div>
</div><div><div> sl_send_reply("483","Too Many Hops");</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>1300 && is_method("NOTIFY") && proto==UDP)</div></div><div><div> {</div></div><div><div> $du = "sip:" + $(ruri{uri.host}) + ":" + $(ruri{uri.port}) + ";transport=tcp";</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'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.</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>