Skip to content
Snippets Groups Projects
Commit 8dcea590 authored by Tristan Matthews's avatar Tristan Matthews Committed by Guillaume Roguez
Browse files

sip: don't do reinvite if hold state is unchanged

Refs #48945

Change-Id: Ic80a99457bde01bd6e7f775d41c55f4359937bf2
parent e4c8ad53
No related branches found
No related tags found
No related merge requests found
...@@ -127,6 +127,9 @@ int SIPSessionReinvite(SIPCall *call) ...@@ -127,6 +127,9 @@ int SIPSessionReinvite(SIPCall *call)
void void
SIPCall::offhold(const std::function<void()> &SDPUpdateFunc) SIPCall::offhold(const std::function<void()> &SDPUpdateFunc)
{ {
if (not setState(Call::ACTIVE))
return;
if (local_sdp_ == NULL) if (local_sdp_ == NULL)
throw SdpException("Could not find sdp session"); throw SdpException("Could not find sdp session");
...@@ -179,14 +182,18 @@ SIPCall::offhold(const std::function<void()> &SDPUpdateFunc) ...@@ -179,14 +182,18 @@ SIPCall::offhold(const std::function<void()> &SDPUpdateFunc)
local_sdp_->addAttributeToLocalVideoMedia("sendrecv"); local_sdp_->addAttributeToLocalVideoMedia("sendrecv");
#endif #endif
if (SIPSessionReinvite(this) == PJ_SUCCESS) if (SIPSessionReinvite(this) != PJ_SUCCESS) {
setState(Call::ACTIVE); WARN("Reinvite failed, resuming hold");
onhold();
}
} }
void void
SIPCall::onhold() SIPCall::onhold()
{ {
setState(Call::HOLD); if (not setState(Call::HOLD))
return;
audiortp_.saveLocalContext(); audiortp_.saveLocalContext();
audiortp_.stop(); audiortp_.stop();
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment