diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 603db92656c4735a951c48470474af9f8bdbdbf8..8fbf682dca6e56bf3a721d6f298c5b963a3f94cf 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -1411,14 +1411,13 @@ void outgoing_request_forked_cb(pjsip_inv_session * /*inv*/, pjsip_event * /*e*/ void transaction_state_changed_cb(pjsip_inv_session * inv, pjsip_transaction *tsx, pjsip_event *event) { - assert(tsx); - assert(event); - - if (tsx->role != PJSIP_ROLE_UAS || tsx->state != PJSIP_TSX_STATE_TRYING) + if (!tsx or !event or tsx->role != PJSIP_ROLE_UAS or + tsx->state != PJSIP_TSX_STATE_TRYING) return; - if (pjsip_method_cmp(&tsx->method, &pjsip_refer_method) ==0) { - onCallTransfered(inv, event->body.tsx_state.src.rdata); /** Handle the refer method **/ + // Handle the refer method + if (pjsip_method_cmp(&tsx->method, &pjsip_refer_method) == 0) { + onCallTransfered(inv, event->body.tsx_state.src.rdata); return; }