From b21a4309831384ee9848b5c59b2a60ab49e5e6d0 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 27 Jun 2024 17:44:53 +0200 Subject: [PATCH] MT#60408 CallLeg: use dedicated fund to check expecting offer Add a function to the AmSipDialog class interface, to be able to check whether the OA currently expects an offer. Use it then in the `CallLeg::updateLocalSdp(AmSdp &sdp)` Change-Id: I1c4f4364ce13c7b03e22e0f037d19b99245a0be8 --- apps/sbc/CallLeg.cpp | 4 +--- core/AmSipDialog.cpp | 6 ++++++ core/AmSipDialog.h | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/sbc/CallLeg.cpp b/apps/sbc/CallLeg.cpp index 953dcb79..2a700af0 100644 --- a/apps/sbc/CallLeg.cpp +++ b/apps/sbc/CallLeg.cpp @@ -1789,9 +1789,7 @@ void CallLeg::updateLocalSdp(AmSdp &sdp) // FIXME: repeated SDP (183, 200) will cause false match in OA_Completed // (need not to be expected with re-INVITEs asking for hold) - if (dlg->getOAState() == AmOfferAnswer::OA_None || - dlg->getOAState() == AmOfferAnswer::OA_Completed) - { + if (dlg->oaExpectingOffer()) { // handling offer adjustOffer(sdp); } diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index 96bbcc37..c0b54ac4 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -223,6 +223,12 @@ void AmSipDialog::setOAState(AmOfferAnswer::OAState n_st) { oa.setState(n_st); } +/** are we expecting to receive an SDP offer? */ +bool AmSipDialog::oaExpectingOffer() { + return oa.getState() == AmOfferAnswer::OA_None || + oa.getState() == AmOfferAnswer::OA_Completed; +} + void AmSipDialog::setRel100State(Am100rel::State rel100_state) { DBG("setting 100rel state for '%s' to %i\n", local_tag.c_str(), rel100_state); rel100.setState(rel100_state); diff --git a/core/AmSipDialog.h b/core/AmSipDialog.h index 3f85288e..c90912dc 100644 --- a/core/AmSipDialog.h +++ b/core/AmSipDialog.h @@ -112,6 +112,8 @@ protected: void setOAForceSDP(bool force) { oa.setForceSDP(force); } bool getOAForceSDP() const { return oa.getForceSDP(); } + bool oaExpectingOffer(); + /* getter/setter for faked 183 as 200OK responses, TT#187351 */ void setFaked183As200(bool value) { faked_183_as_200 = value; } bool getFaked183As200() { return faked_183_as_200; }