From 91039bb8a90eb79f6e9781063e159e88f04bed02 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Mon, 20 Feb 2023 16:24:01 +0100 Subject: [PATCH] MT#56321 Refresh caller if 183 media forced (part 2) B2BSipReply We have to update the media session with the caller, if the 183 response with the 'P-Early-Announce: force' has been received. Change-Id: Iec67c6b6cc5284afbcfb492fc53108439a427b1d --- core/AmB2BSession.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index 95347a99..1bb850c2 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -291,8 +291,20 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev) } } else { + + /* ensure that 'P-Early-Announce: force' is not present */ + if (reply_ev->reply.code == 183 && !dlg->getForcedEarlyAnnounce()) { + string announce = getHeader(reply_ev->reply.hdrs, SIP_HDR_P_EARLY_ANNOUNCE); + dlg->setForcedEarlyAnnounce(announce.find("force") != std::string::npos); + } + + /* don't forget to reset the force_early_announce, if 200 OK in the same leg received */ + if (SIP_IS_200_CLASS(reply_ev->reply.code) && dlg->getForcedEarlyAnnounce()) { + dlg->setForcedEarlyAnnounce(false); + } + /* check whether not-forwarded (locally initiated) - * INV/UPD transaction changed session in other leg */ + * INV/UPD transaction changed session in other leg */ if (SIP_IS_200_CLASS(reply_ev->reply.code) && (!reply_ev->reply.body.empty()) && (reply_ev->reply.cseq_method == SIP_METH_INVITE ||