[OpenSIPS-Users] [OpenSIPS-Devel] Re-invite ACK Troubles - Not going to my NAT Handling route

Marc Leurent marc.leurent at vtx-telecom.ch
Fri Jul 31 10:41:16 CEST 2009


Hello Iñaki, thanks for the quick answer, and yes you're completely right!

Here is the rest of the opensip.cfg, I set  t_on_branch("1"); t_on_reply("1"); t_on_failure("1"); later



# main request routing logic

route{

        # Reject Packet if SIP TTL is too low
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                exit;
        }
        # Test NATed contact
        route(2);

        if (has_totag()) {      # Check To Header field uri contains tag parameter.
                # sequential request withing a dialog should
                # take the path determined by record-routing
                if (loose_route()) {    # The function performs routing of SIP requests which contain a route set.
                        if (is_method("BYE")) {
                                setflag(1); # do accounting ...
                                setflag(3); # ... even if the transaction fails
                        } else if (is_method("INVITE")) {
                                # even if in most of the cases is useless, do RR for
                                # re-INVITEs alos, as some buggy clients do change route set
                                # during the dialog.
                                record_route();
                        }
                        # route it out to whatever destination was set by loose_route()
                        # in $du (destination URI).
                        route(1);
                } else {
                        /* uncomment the following lines if you want to enable presence */
                        ##if (is_method("SUBSCRIBE") && $rd == "your.server.ip.address") {
                        ##      # in-dialog subscribe requests
                        ##      route(9);
                        ##      exit;
                        ##}
                        if ( is_method("ACK") ) {
                                if ( t_check_trans() ) {        # true if the ACK is a local end-to-end
                                                                # ACK corresponding to an previous INVITE transaction.
                                        # non loose-route, but stateful ACK; must be an ACK after
                                        # a 487 or e.g. 404 from upstream server
                                        t_relay();
                                        exit;
                                } else {
                                        # ACK without matching transaction ->
                                        # ignore and discard.\n");
                                        exit;

                                }
                        }
                        sl_send_reply("404","Not here");
                }
                exit;
        }
        # CANCEL processing
        if (is_method("CANCEL"))
        {
                if (t_check_trans())    # true if the cancelled INVITE transaction exists.
                        t_relay();
                exit;
        }

        t_check_trans();
        # record routing
        #if (!is_method("REGISTER|MESSAGE"))
        record_route();

        # Set Default Branch, Reply and Failure Route
        t_on_branch("1");
        t_on_reply("1");
        t_on_failure("1");

        # account only INVITEs
        if (is_method("INVITE")) {
                setflag(1); # do accounting
                setflag(4); # Active Dialog Module Start Statistics
#               trace_dialog(); # Enable SIP Trace if race_mode is turned on
        }

....
....

}



-- 
-- --
Marc LEURENT
Ingénieur VoIP

DECKPOINT SA
Une société du groupe VTX Telecom
================================================================
Rue Eugène-Marziano 15 - 1227 Les Acacias
http://www.vtx.ch - marc.leurent at vtx-telecom.ch
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

Le vendredi, 31 juillet 2009 10.28:56, Iñaki Baz Castillo a écrit :
> 2009/7/31 Marc Leurent <lftsy at leurent.eu>:
> > Hello everybody, for those who are not in holidays under the sun...
> > I have already checked, on no previous exchange on the mailing list seems
> > to answer to this problem..
> >
> > My version of OpenSIPs is OpenSIPS (1.4.5-notls (x86_64/linux))
> >
> > I have a problem when a 200 OK of a re-INVITE. Indeed, I use a route(2)
> > to handle NAT correction, I have put the route(2) at the beginning of
> > main route, on onreply_route, on failure_route, and on branch_route. So,
> > for each packets, it should go inside the route(2)...
>
> Hi Mark, I think this question should just go to user maillist :)
>
>
> In your config I don't see where the branch route is set for in-dialog
> requests ¿?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090731/0dfa2d3b/attachment.htm 


More information about the Users mailing list