1

我在 MSS-Tomcat 之上运行 B2BUA 应用程序。我的应用程序处理了 BYE 请求,但 BYE 的重新传输被作为重复文件丢弃。我希望在我们使用 UDP 时处理重传。

我们设法在附加的跟踪中使用 SIPP 重现了该问题。 https://drive.google.com/file/d/0B2ZkUreEJkenVU9YQnBYUDBYVTA/view?usp=drivesdk

这是 Mobicents 日志的一部分:

2017-05-21 17:58:41,242 DEBUG [EventScanner] (Mobicents-SIP-Servlets-UDPMessageChannelThread-9) sipEvent = gov.nist.javax.sip.RequestEventExt[source=gov.nist.javax.sip.SipProviderImpl@21a77f66]source = gov.nist.javax.sip.SipProviderImpl@21a77f66
2017-05-21 17:58:41,242 DEBUG [EventScanner] (Mobicents-SIP-Servlets-UDPMessageChannelThread-9) deliverEvent : BYE sip:+16865721235@135.76.2.65:39000;transport=UDP SIP/2.0
transaction gov.nist.javax.sip.stack.SIPServerTransactionImpl@58d4e299 sipEvent.serverTx = gov.nist.javax.sip.stack.SIPServerTransactionImpl@58d4e299
2017-05-21 17:58:41,242 DEBUG [SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-9) serverTx: looking for key z9hg4bk-10317-1-6 existing={z9hg4bk-10317-1-0=gov.nist.javax.sip.stack.SIPServerTransactionImpl@58d4e293, z9hg4bk-10317-1-6=gov.nist.javax.sip.stack.SIPServerTransactionImpl@58d4e299}
2017-05-21 17:58:41,242 DEBUG [SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-9) findTransaction: returning  : gov.nist.javax.sip.stack.SIPServerTransactionImpl@58d4e299
2017-05-21 17:58:41,242 DEBUG [EventScanner] (Mobicents-SIP-Servlets-UDPMessageChannelThread-9) transaction already exists! gov.nist.javax.sip.stack.SIPServerTransactionImpl@58d4e299
2017-05-21 17:58:41,242 DEBUG [EventScanner] (Mobicents-SIP-Servlets-UDPMessageChannelThread-9) Done processing Message BYE sip:+16865721235@135.76.2.65:39000;transport=UDP SIP/2.0

这是我们在 EventScanner 中找到的相关代码:

       if (sipEvent instanceof RequestEvent) {
        try {
            // Check if this request has already created a
            // transaction
            SIPRequest sipRequest = (SIPRequest) ((RequestEvent) sipEvent)
                    .getRequest();

            if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG)) {
                logger.logDebug(
                        "deliverEvent : "
                                + sipRequest.getFirstLine()
                                + " transaction "
                                + eventWrapper.transaction
                                + " sipEvent.serverTx = "
                                + ((RequestEvent) sipEvent)
                                        .getServerTransaction());
            }

            // Discard the duplicate request if a
            // transaction already exists. If the listener chose
            // to handle the request statelessly, then the listener
            // will see the retransmission.
            // Note that in both of these two cases, JAIN SIP will allow
            // you to handle the request statefully or statelessly.
            // An example of the latter case is REGISTER and an example
            // of the former case is INVITE.

            SIPServerTransaction tx = (SIPServerTransaction) sipStack
                    .findTransaction(sipRequest, true);

            if (tx != null && !tx.passToListener()) {

                // JvB: make an exception for a very rare case: some
                // (broken) UACs use
                // the same branch parameter for an ACK. Such an ACK should
                // be passed
                // to the listener (tx == INVITE ST, terminated upon sending
                // 2xx but
                // lingering to catch retransmitted INVITEs)
                if (sipRequest.getMethod().equals(Request.ACK)
                        && tx.isInviteTransaction() &&
                        ( tx.getLastResponseStatusCode() / 100 == 2 ||
                            sipStack.isNon2XXAckPassedToListener())) {

                    if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG))
                        logger
                                .logDebug(
                                        "Detected broken client sending ACK with same branch! Passing...");
                } else {
                    if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG))
                        logger.logDebug(
                                "transaction already exists! " + tx);
                    return;
                }
            } else if (sipStack.findPendingTransaction(sipRequest.getTransactionId()) != null) {
                if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG))
                    logger.logDebug(
                            "transaction already exists!!");

                return;
            }

我们在 Mobicents/Tomcat 版本 mss-4.0.21-apache-tomcat-8.0.26 中使用 jain-sip-ri 1.2.242。

任何帮助将不胜感激!

4

0 回答 0