diff options
author | Liong Sauw Ming <ming@teluu.com> | 2015-05-15 07:19:28 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2015-05-15 07:19:28 +0000 |
commit | f33fab4fc22321a8c4e19015f9a11b6299272e3e (patch) | |
tree | 5929cd2b6007de0effa9e11cc62ae1752c211148 /pjsip/src | |
parent | 022019f99c320ded6eecf71bf437c9ac09d07884 (diff) |
Fixed #1852: Assertion due to premature destroy of dialog when media channel init fails during incoming call
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5096 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 537d3980..41b9e030 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -1480,20 +1480,27 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) * on_incoming_call_med_tp_complete(), so we need to send * a response message and terminate the invite here. */ + pjsip_dlg_inc_lock(dlg); pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL); if (call->inv && call->inv->dlg) { pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE); } + pjsip_dlg_dec_lock(dlg); + call->inv = NULL; call->async_call.dlg = NULL; goto on_return; } } else if (status != PJ_EPENDING) { pjsua_perror(THIS_FILE, "Error initializing media channel", status); + + pjsip_dlg_inc_lock(dlg); pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL); if (call->inv && call->inv->dlg) { pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE); } + pjsip_dlg_dec_lock(dlg); + call->inv = NULL; call->async_call.dlg = NULL; goto on_return; |