Skip to content
Snippets Groups Projects
Commit 69ce4981 authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez
Browse files

sipcall: add onPeerRinging

Refs #69086

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