From 2cdd0a694115647597f967768aeb1970192e84d8 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 25 Jul 2025 10:09:59 +0200 Subject: [PATCH] MT#62859 AmB2BSession::onB2BEvent send fake SDP answer In case of INVITE pending UAC transactions for the other leg, and new coming in (like 200OK send to this leg, and just right after that re-INVITE), just provide a fake SDP answer (200OK) in the meanwhile. And expect that a finished UAC transaction on the other side, must trigger a consequent update for this leg, what will finish these media negotiations. Change-Id: I190dfcd5467c728e2192940dfac8454f708cecaf --- core/AmB2BSession.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index 018e5de9..83354eab 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -327,13 +327,19 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev) } if (req_ev->req.method == SIP_METH_INVITE && dlg->getUACInvTransPending()) { - /* don't relay INVITE if INV trans pending */ - ILOG_DLG(L_DBG, "Not sip-relaying INVITE with pending INV transaction, b2b-relaying 491 pending\n"); - relayError(req_ev->req.method, req_ev->req.cseq, true, 491, SIP_REPLY_PENDING); + ILOG_DLG(L_DBG, "There are still pending UAC INVITE transactions, this leg: '%s' (UAC) -> other leg: '%s'\n", + dlg->getLocalTag().c_str(), + getOtherId().c_str()); + ILOG_DLG(L_DBG, "Sending a fake 200OK to this transaction in the meanwhile (CSeq: %d)\n", req_ev->req.cseq); + /* UAC side (other side) already has a pending update, this one just overrides it? + * let the UAC respond, what will trigger a back update again and negotiations should be finished by that + */ + acceptPendingInviteB2B(req_ev->req); return; } - if (req_ev->req.method == SIP_METH_BYE && dlg->getStatus() != AmBasicSipDialog::Connected) { + if (req_ev->req.method == SIP_METH_BYE && + dlg->getStatus() != AmBasicSipDialog::Connected) { ILOG_DLG(L_DBG, "not sip-relaying BYE in not connected dlg, b2b-relaying 200 OK\n"); relayError(req_ev->req.method, req_ev->req.cseq, true, 200, "OK"); return;