From 6aa2517d1a17e3cb2e610dd38f71664fcb62feab Mon Sep 17 00:00:00 2001 From: XAVER Florian Date: Tue, 7 Nov 2023 09:15:03 +0100 Subject: [PATCH 1/2] Fix answering a re-INVITE Commit f3a261345f448dd63b98d66c06dd5f283840e17b introduces a problem with answering incoming re-INVITE manually by the app in cases, where the UAC receives the re-INVITE. Issue #3769 --- pjsip/src/pjsua-lib/pjsua_call.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 0a78d0f963..37e313cea3 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -2744,7 +2744,7 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id, if (status != PJ_SUCCESS) goto on_return; - if (call->inv->role == PJSIP_ROLE_UAC || + if ((call->inv->role == PJSIP_ROLE_UAC && call->inv->state != PJSIP_INV_STATE_CONFIRMED) || !call->inv->invite_tsx || call->inv->invite_tsx->state >= PJSIP_TSX_STATE_COMPLETED) { From 7886a0db167ab0a2bc57c8de78c5e4fe09ccf25c Mon Sep 17 00:00:00 2001 From: sauwming Date: Tue, 2 Jan 2024 11:53:15 +0800 Subject: [PATCH 2/2] Update pjsua_call.c --- pjsip/src/pjsua-lib/pjsua_call.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 37e313cea3..d0489cc908 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -2744,8 +2744,8 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id, if (status != PJ_SUCCESS) goto on_return; - if ((call->inv->role == PJSIP_ROLE_UAC && call->inv->state != PJSIP_INV_STATE_CONFIRMED) || - !call->inv->invite_tsx || + if (!call->inv->invite_tsx || + call->inv->invite_tsx->role != PJSIP_ROLE_UAC || call->inv->invite_tsx->state >= PJSIP_TSX_STATE_COMPLETED) { PJ_LOG(3,(THIS_FILE, "Unable to answer call (no incoming INVITE or "