kamailio:Kamailio在200 OK后未路由ACK

时间:2020-09-23 07:46:03

标签: kamailio ims

有人可以帮助我解决kamailio的问题吗,我使用kamailio作为代理和路由器,PSTN路由工作正常,但是响应200OK的ACK有问题,而kamailio没有转发该消息。

在客户端的SIP流程下方。

                             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

200 OK之后,我从kamailio收到404“不在这里”。这是我拥有的CFG。由于我是kamailio工具的新手,因此不确定如何解决此问题。

# 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;
}

请帮助。 预先感谢。

1 个答案:

答案 0 :(得分:0)

通过添加以下内容来解决它//

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