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