[SR-Users] Record-route in dialog requests

Spencer Thomason spencer at 5ninesolutions.com
Fri Oct 18 19:25:09 CEST 2013


Hello,
In our network topology we use Kamailio at the edge of our network proxying requests from a core set of FreeSWITCH servers.  

I have a new termination provider where a session timer ReINVITE fails because the ACK is sent to the contact address of the FreeSWITCH server, not the proxy.  Can I Record-Route these in dialog requests?  If so, where should I do it in the config?  

A quick google search returned this thread:
https://lists.cs.columbia.edu/pipermail/sip-implementors/2003-June/005089.html
which confused me a little.

Thanks,
Spencer


My in dialog config block looks like this:
# Handle requests within SIP dialogs
route[WITHINDLG] {
    if (has_totag()) {
        # sequential request withing a dialog should
        # take the path determined by record-routing
        if (loose_route()) {
            if (is_method("BYE")) {
                setflag(FLT_ACC); # do accounting ...
                setflag(FLT_ACCFAILED); # ... even if the transaction fails
                setflag(FLT_SIPTRACE);
            }
            if (is_method("ACK")) {
                # ACK is forwarded statelessy
                    route(NATMANAGE);
                }
            route(RELAY);
        } else {
            if ( is_method("ACK") ) {
                if (t_check_trans()) {
                    # no 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
                    exit;
                }
            }
            sl_send_reply("404","Not here");
        }
        exit;
    }
}


More information about the sr-users mailing list