diff --git a/debian/patches/series b/debian/patches/series index d517bc6a..f9d905d3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -29,3 +29,4 @@ fix-build-with-newer-openssl.patch sipwise/0020-TT-9521-fix-200OK-without-SPD.patch sipwise/usage-reporting.patch sipwise/session_timers +sipwise/introduce_forcesdp_from_pbx.patch diff --git a/debian/patches/sipwise/introduce_forcesdp_from_pbx.patch b/debian/patches/sipwise/introduce_forcesdp_from_pbx.patch new file mode 100644 index 00000000..88aa4d63 --- /dev/null +++ b/debian/patches/sipwise/introduce_forcesdp_from_pbx.patch @@ -0,0 +1,91 @@ +--- a/core/AmOfferAnswer.cpp ++++ b/core/AmOfferAnswer.cpp +@@ -53,7 +53,8 @@ AmOfferAnswer::AmOfferAnswer(AmSipDialog + cseq(0), + sdp_remote(), + sdp_local(), +- dlg(dlg) ++ dlg(dlg), ++ force_sdp(true) + { + + } +@@ -322,7 +323,7 @@ int AmOfferAnswer::onRequestOut(AmSipReq + sdp_buf.length()); + has_sdp = true; + } +- else { ++ else if(force_sdp) { + return -1; + } + } else if (sdp_body && has_sdp) { +@@ -395,7 +396,7 @@ int AmOfferAnswer::onReplyOut(AmSipReply + else if (reply.code == 200 && reply.cseq_method == SIP_METH_INVITE && state == OA_Completed) { + // just ignore if no SDP is generated (required for B2B) + } +- else return -1; ++ else if(force_sdp) return -1; + } + else { + if(!sdp_body){ +--- a/apps/sbc/CallLeg.cpp ++++ b/apps/sbc/CallLeg.cpp +@@ -197,7 +197,10 @@ CallLeg::CallLeg(const CallLeg* caller, + set_sip_relay_only(false); // will be changed later on (for now we have no peer so we can't relay) + + // enable OA for the purpose of hold request detection +- if (dlg) dlg->setOAEnabled(true); ++ if (dlg) { ++ dlg->setOAEnabled(true); ++ dlg->setOAForceSDP(false); ++ } + else WARN("can't enable OA!\n"); + + // code below taken from createCalleeSession +@@ -259,7 +262,10 @@ CallLeg::CallLeg(AmSipDialog* p_dlg, AmS + set_sip_relay_only(false); + + // enable OA for the purpose of hold request detection +- if (dlg) dlg->setOAEnabled(true); ++ if (dlg) { ++ dlg->setOAEnabled(true); ++ dlg->setOAForceSDP(false); ++ } + else WARN("can't enable OA!\n"); + } + +--- a/core/AmOfferAnswer.h ++++ b/core/AmOfferAnswer.h +@@ -53,6 +53,9 @@ private: + + AmSipDialog* dlg; + ++ /** Should SDP generation be forced when not required by standards? */ ++ bool force_sdp; ++ + /** State maintenance */ + void saveState(); + int checkStateChange(); +@@ -75,6 +78,9 @@ public: + void clear(); + void clearTransitionalState(); + ++ void setForceSDP(bool force) { force_sdp = force; } ++ bool getForceSDP() const { return force_sdp; } ++ + /** Event handlers */ + int onRequestIn(const AmSipRequest& req); + int onReplyIn(const AmSipReply& reply); +--- a/core/AmSipDialog.h ++++ b/core/AmSipDialog.h +@@ -95,6 +95,10 @@ protected: + AmOfferAnswer::OAState getOAState(); + void setOAState(AmOfferAnswer::OAState n_st); + void setOAEnabled(bool oa_enabled); ++ ++ void setOAForceSDP(bool force) { oa.setForceSDP(force); } ++ bool getOAForceSDP() const { return oa.getForceSDP(); } ++ + const AmSdp& getLocalSdp() { return oa.getLocalSdp(); } + const AmSdp& getRemoteSdp() { return oa.getRemoteSdp(); } +