Skip to content

Commit b9619cd

Browse files
authored
Fixed incorrect call count upon message sending failure when making call (#4410)
1 parent e9dcd8e commit b9619cd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pjsip/src/pjsua-lib/pjsua_call.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,14 @@ on_make_call_med_tp_complete(pjsua_call_id call_id,
573573
if (status != PJ_SUCCESS) {
574574
cb_called = PJ_TRUE;
575575

576-
/* Upon failure to send first request, the invite
577-
* session would have been cleared.
576+
/* If call inv hasn't been cleared from on_call_state(DISCONNECTED),
577+
* we clear it here.
578578
*/
579+
if (call->inv) {
580+
pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE);
581+
--pjsua_var.call_cnt;
582+
}
583+
579584
call->inv = inv = NULL;
580585
goto on_error;
581586
}

0 commit comments

Comments
 (0)