[OpenSIPS-Devel] [nat_traversal] "nat_keepalive()" doesn't work before "t_newtran()"

Dan Pascu dan at ag-projects.com
Wed Nov 12 10:48:55 CET 2008


On Wednesday 12 November 2008, Iñaki Baz Castillo wrote:
> Hi, I've realized that using "t_newtran()" after "nat_keepalive()" and
> before "handle_subscribe()" makes NAT keepalive not working.
>
> This is:
>
> 	if nat_uac_test("19") {
> 		fix_contact();
> 		if is_method("INVITE|SUBSCRIBE") {
> 			nat_keepalive();
> 		}
> 	}
>
> 	if ! t_newtran() {
> 		sl_reply_error();
> 		exit;
> 	}
>
> 	if is_method("SUBSCRIBE") {
> 		handle_subscribe();
> 		t_release();
> 		exit;
> 	}
>
> With this code, nat_keepalive will not work, except if we delete
> the "t_newtran" section (so ti will work).
>
> Is it the expected behaviour? I don't think so, am I wrong?

If it does this it's a bug. However I can't reproduce it. My systems work 
just fine. I use the following sequences (simplified for brevity) and 
never had a problem with them:

for INVITE:
 ...
 nat_traversal();
 ...
 t_relay(); // implicitly calls t_newtran() internally

for SUBSCRIBE:

 nat_traversal();
 ...
 t_newtran();
 handle_subscribe();
 t_release();

-- 
Dan



More information about the Devel mailing list