From 84a20addc88f9cc6bdcf242a7b5a349af85edc3c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 16 Apr 2020 04:17:16 +0400 Subject: [PATCH] [sofia-sip] Fix crash in timer B outgoing_timer_bf() which asserts if INVITE request was completed already. --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nta/nta.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 4fe074aa97..70251da952 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed Apr 1 12:53:24 MDT 2020 +Thu Apr 16 17:42:40 UTC 2020 diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index ca67cc032f..07bab4f6eb 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -8965,8 +8965,17 @@ void outgoing_trying(nta_outgoing_t *orq) { if (orq->orq_forked) ; - else if (orq->orq_method == sip_method_invite) - outgoing_queue(orq->orq_agent->sa_out.inv_calling, orq); + else if (orq->orq_method == sip_method_invite) { + if (!orq->orq_completed) { + outgoing_queue(orq->orq_agent->sa_out.inv_calling, orq); + } else { + SU_DEBUG_5(("nta(%p): completed request can not be put into inv_calling queue (%u)\n", (void *)orq, orq->orq_cseq->cs_seq)); + if (orq->orq_queue != orq->orq_agent->sa_out.inv_completed) { + /* Put back into inv_completed if it's not there by any reason */ + outgoing_queue(orq->orq_agent->sa_out.inv_completed, orq); /* Timer D */ + } + } + } else outgoing_queue(orq->orq_agent->sa_out.trying, orq); } -- 2.47.2