kamailio: Kamailio not routing ACK after 200 OK

2k Views Asked by At

Could any one help me on this kamailio issue, i am using kamailio as a proxy & router, PSTN route works fine, but have a problem with the ACK in response to 200OK which is not being forwarded by kamailio.

below the SIP flow at client side.

                             Messages  Retrans   Timeout   Unexpected-Msg
  INVITE ---------->         1         0
     100 <----------         1         0         0         0
     183 <----------         0         0         0         0
     180 <----------  E-RTD1 1         0         0         0
     200 <----------  E-RTD1 1         1         0         0
     ACK ---------->         1         1
   Pause [   3000ms]         1                             0
     BYE ---------->         1         0         0
     200 <----------         0         0         0         1

after 200 OK, i have received 404 "Not here" from kamailio. Here is the cfg i have.. not sure how to solve this, since i am new to kamailio tool.

# Handle requests within SIP dialogs
route[WITHINDLG] {
    if (!has_totag()) return;

    # sequential request withing a dialog should
    # take the path determined by record-routing
    if (loose_route()) {
        route(DLGURI);
        if (is_method("BYE")) {
            setflag(FLT_ACC); # do accounting ...
            setflag(FLT_ACCFAILED); # ... even if the transaction fails
        } else if ( is_method("ACK") ) {
            # ACK is forwarded statelessly
            route(NATMANAGE);
        } else if ( is_method("NOTIFY") ) {
            # Add Record-Route for in-dialog NOTIFY as per RFC 6665.
            record_route();
        }
        route(RELAY);
        exit;
    }

    if (is_method("SUBSCRIBE") && uri == myself) {
        # in-dialog subscribe requests
        route(PRESENCE);
        exit;
    }
    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
            route(RELAY);
            exit;
        } else {
           
            # ACK without matching transaction ... ignore and discard
            exit;
        }
    }
    sl_send_reply("404","Not here");
    exit;
}

Please help.. thanks in advance.

1

There are 1 best solutions below

0
On

Solved it by adding below//

     if (is_method("ACK|BYE")) {
             $duri= $ruri;
             t_relay();
             exit;
     }