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

Dan Pascu dan at ag-projects.com
Wed Nov 12 15:35:59 CET 2008


On Wednesday 12 November 2008, Iñaki Baz Castillo wrote:
> 2008/11/12 Dan Pascu <dan at ag-projects.com>:
> > On Wednesday 12 November 2008, Iñaki Baz Castillo wrote:
> >> 2008/11/12 Dan Pascu <dan at ag-projects.com>:
> >> > for SUBSCRIBE:
> >> >
> >> >  nat_traversal();
> >> >  ...
> >> >  t_newtran();
> >> >  handle_subscribe();
> >> >  t_release();
> >>
> >> The above code produces no keepalive in my system. I will rechek it.
> >
> > Please post the output from:
> >
> > opensipsctl fifo get_statistics nat_traversal:
>
> As clarification, I use rev 4943 with a UDP client (Twinkle) who

If you use opensips trunk, then I think I know where the problem is.
For a SUBSCRIBE method nat_traversal will register a hook to capture 
stateless replies and on to receive incoming TM replies to find out from 
the answer if it was a positive one and the duration until it expires.

That was fine in 1.4 because handle_subscribe() did send stateless 
replies, even when you surrounded it with t_newtran/t_release to protect 
against retransmissions. In this case the stateless reply hook did 
capture the replies. The TM in hook captured replies for SUBSCRIBEs that 
were forwarded using t_relay.

Now in trunk, presence changed from using sl_send_reply to using the new 
signaling module which will use t_reply instead if you called t_newtran, 
but being a proxy generated reply it won't hit the TM input callback.

I'm not sure at this point if the solution is as simple as to use the 
outgoing TM callback. I do not have the time right now to analyze the 
consequences, but if you are willing to experiment, you can try to change 
the code to use the outgoing TM callback.

Also to clarify things, with trunk it won't work at all no matter if you 
call nat_keepalive before or after t_newtran. As long as you use 
t_newtran it won't catch replies, except when SUBSCRIBE is forwarded with 
t_relay, but never when handled locally with handle_subscribe. With 
INVITEs OTOH, it works because INVITEs are always forwarded and INVITEs 
use the dialog module, so a different mechanism.

-- 
Dan



More information about the Devel mailing list