Commit 49ae87db authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix crash in call_ack_being_sent callback when an automatic wrapper is being used.

parent f00a5b0c
...@@ -480,6 +480,8 @@ void SalCallOp::processResponseCb (void *userCtx, const belle_sip_response_event ...@@ -480,6 +480,8 @@ void SalCallOp::processResponseCb (void *userCtx, const belle_sip_response_event
lError() << "This call has been already terminated"; lError() << "This call has been already terminated";
return; return;
} }
// Ref the ack request so that it is not destroyed when the call_ack_being_sent callbacks is called
belle_sip_object_ref(ack);
if (op->mSdpAnswer) { if (op->mSdpAnswer) {
setSdp(BELLE_SIP_MESSAGE(ack), op->mSdpAnswer); setSdp(BELLE_SIP_MESSAGE(ack), op->mSdpAnswer);
belle_sip_object_unref(op->mSdpAnswer); belle_sip_object_unref(op->mSdpAnswer);
...@@ -489,6 +491,7 @@ void SalCallOp::processResponseCb (void *userCtx, const belle_sip_response_event ...@@ -489,6 +491,7 @@ void SalCallOp::processResponseCb (void *userCtx, const belle_sip_response_event
op->mRoot->mCallbacks.call_accepted(op); // INVITE op->mRoot->mCallbacks.call_accepted(op); // INVITE
op->mRoot->mCallbacks.call_ack_being_sent(op, reinterpret_cast<SalCustomHeader *>(ack)); op->mRoot->mCallbacks.call_ack_being_sent(op, reinterpret_cast<SalCustomHeader *>(ack));
belle_sip_dialog_send_ack(op->mDialog, ack); belle_sip_dialog_send_ack(op->mDialog, ack);
belle_sip_object_unref(ack);
op->mState = State::Active; op->mState = State::Active;
} else if (code >= 300) { } else if (code >= 300) {
op->setError(response, false); op->setError(response, false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment