Skip to content
Snippets Groups Projects
Commit 76209a03 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

certstore: fix nullptr reference in setStoreCertStatus

sipcall: terminate SIP call with peer before stopping media

Change-Id: If8c6573f81f5efdce8a0a05870cdd0ab4f2f7047
parent 6ca99c93
No related branches found
No related tags found
No related merge requests found
......@@ -564,7 +564,7 @@ TrustStore::updateKnownCerts()
void
TrustStore::setStoreCertStatus(const crypto::Certificate& crt, TrustStore::PermissionStatus status)
{
if (not crt.isCA())
if (not crt.isCA() || not allowed_)
return;
if (status == PermissionStatus::ALLOWED)
......
......@@ -367,35 +367,26 @@ SIPCall::answer()
void
SIPCall::hangup(int reason)
{
// Stop all RTP streams
stopAllMedia();
if (not inv or not inv->dlg) {
removeCall();
throw VoipLinkException("[call:" + getCallId() + "] hangup: no invite session for this call");
}
if (inv and inv->dlg) {
pjsip_route_hdr *route = inv->dlg->route_set.next;
while (route and route != &inv->dlg->route_set) {
char buf[1024];
int printed = pjsip_hdr_print_on(route, buf, sizeof(buf));
if (printed >= 0) {
buf[printed] = '\0';
RING_DBG("[call:%s] Route header %s", getCallId().c_str(), buf);
}
route = route->next;
}
const int status = reason ? reason :
inv->state <= PJSIP_INV_STATE_EARLY and inv->role != PJSIP_ROLE_UAC ?
PJSIP_SC_CALL_TSX_DOES_NOT_EXIST :
inv->state >= PJSIP_INV_STATE_DISCONNECTED ? PJSIP_SC_DECLINE : 0;
// Notify the peer
terminateSipSession(status);
}
// Stop all RTP streams
stopAllMedia();
setState(Call::ConnectionState::DISCONNECTED, reason);
removeCall();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment