Allow configuration of SIP error code to be used when declining a call because it has not been answered after the incoming call timeout.

This commit is contained in:
Ghislain MARY 2018-06-14 17:02:57 +02:00
parent 963322a508
commit 3a33105bea

View file

@ -345,9 +345,9 @@ void CallPrivate::onIncomingCallSessionTimeoutCheck (const shared_ptr<CallSessio
lInfo() << "Incoming call ringing for " << elapsed << " seconds";
if (elapsed > q->getCore()->getCCore()->sip_conf.inc_timeout) {
lInfo() << "Incoming call timeout (" << q->getCore()->getCCore()->sip_conf.inc_timeout << ")";
LinphoneReason declineReason = (q->getCore()->getCurrentCall() != q->getSharedFromThis())
? LinphoneReasonBusy : LinphoneReasonDeclined;
getActiveSession()->declineNotAnswered(declineReason);
auto config = linphone_core_get_config(q->getCore()->getCCore());
int statusCode = linphone_config_get_int(config, "sip", "inc_timeout_status_code", 486);
getActiveSession()->declineNotAnswered(linphone_error_code_to_reason(statusCode));
}
}