Skip to content
Snippets Groups Projects
Commit 9b4e874e authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

sipaccount: call SIPStartCall after returning call

Some functions in SIPStartCall can take a long time to return, such
as ICE initialization. This allows the manager to return the callId
in outgoingCall() to the client sooner and so prevents the UI from
freezing.

Change-Id: I87b0c4b5d56f69e087f0117b2b78daa026679aab
Tuleap: #620
parent e4daf6cd
No related branches found
No related tags found
No related merge requests found
......@@ -240,8 +240,21 @@ SIPAccount::newOutgoingCall(const std::string& toUrl)
getSrtpKeyExchange()
);
if (not created or not SIPStartCall(call))
if (created) {
auto shared_this = std::static_pointer_cast<SIPAccount>(shared_from_this());
std::weak_ptr<SIPCall> weak_call = call;
manager.addTask([shared_this, weak_call] {
auto call = weak_call.lock();
if (not call or not shared_this->SIPStartCall(call)) {
RING_ERR("Could not send outgoing INVITE request for new call");
call->onFailure();
}
return false;
});
} else {
throw VoipLinkException("Could not send outgoing INVITE request for new call");
}
return call;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment