Fixed crash when answering an outgoing call in early state (#3537)

This commit is contained in:
sauwming 2023-05-01 09:01:40 +08:00 committed by GitHub
parent 44b9c36c74
commit f3a261345f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2663,7 +2663,8 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id,
if (status != PJ_SUCCESS)
goto on_return;
if (!call->inv->invite_tsx ||
if (call->inv->role == PJSIP_ROLE_UAC ||
!call->inv->invite_tsx ||
call->inv->invite_tsx->state >= PJSIP_TSX_STATE_COMPLETED)
{
PJ_LOG(3,(THIS_FILE, "Unable to answer call (no incoming INVITE or "