[Kamailio-Users] Relaying NOTIFY UDP messages over TCP
Iñaki Baz Castillo
ibc at aliax.net
Tue Mar 9 14:10:46 CET 2010
2010/3/9 Pascal Maugeri <pascal.maugeri at gmail.com>:
> 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 ?
Does such NOTIFY go to a TCP registered user? Of course if there is
not an existing TCP connection between Kamailio and the final natted
user then it's not possible to send such NOTIFY.
> Is it acceptable to change the $du and then execute the t_relay as we did ?
Yes.
--
Iñaki Baz Castillo
<ibc at aliax.net>
More information about the sr-users
mailing list