Commit 69ce4981 authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez

sipcall: add onPeerRinging

Refs #69086

Change-Id: I5da61d5041cc2aeeb939f39356a835f5c2bb264f
parent 8eb69373
......@@ -701,6 +701,13 @@ SIPCall::onAnswered()
}
}
void
SIPCall::onPeerRinging()
{
setConnectionState(Call::RINGING);
Manager::instance().peerRingingCall(*this);
}
void
SIPCall::setupLocalSDPFromIce()
{
......
......@@ -171,6 +171,12 @@ class SIPCall : public Call
void updateSDPFromSTUN();
/**
* Tell the user that the call is ringing
* @param
*/
void onPeerRinging();
/**
* Tell the user that the call was answered
* @param
......
......@@ -784,13 +784,6 @@ SIPVoIPLink::requestKeyframe(const std::string &callID)
// Private functions
///////////////////////////////////////////////////////////////////////////////
static void
makeCallRing(SIPCall &call)
{
call.setConnectionState(Call::RINGING);
Manager::instance().peerRingingCall(call);
}
static void
invite_session_state_changed_cb(pjsip_inv_session *inv, pjsip_event *ev)
{
......@@ -819,7 +812,7 @@ invite_session_state_changed_cb(pjsip_inv_session *inv, pjsip_event *ev)
if (inv->state == PJSIP_INV_STATE_EARLY and ev and ev->body.tsx_state.tsx and
ev->body.tsx_state.tsx->role == PJSIP_ROLE_UAC) {
makeCallRing(*call);
call->onPeerRinging();
} else if (inv->state == PJSIP_INV_STATE_CONFIRMED and ev) {
// After we sent or received a ACK - The connection is established
call->onAnswered();
......@@ -1121,7 +1114,7 @@ transaction_state_changed_cb(pjsip_inv_session * inv, pjsip_transaction *tsx,
return;
} else if (msg.find("Ringing") != std::string::npos and call) {
if (call)
makeCallRing(*call);
call->onPeerRinging();
else
RING_WARN("Ringing state on non existing call");
sendOK(inv->dlg, r_data, tsx);
......
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