summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-12-23 03:07:33 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-12-23 03:07:33 +0000
commit19c0c8289b20c2c65638e50811319e74f6cdb99e (patch)
treeab21672b627d6685fcb7e485806b2f33eba8c80f /pjsip
parent3a73a091c1b923f2c1fe94e45770127b4300c7e6 (diff)
Re #1430: Fixed crash when STUN & ICE is off
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3919 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index 020570cd..c3b459c7 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -712,6 +712,12 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
}
call->async_call.dlg = dlg;
+ /* Temporarily increment dialog session. Without this, dialog will be
+ * prematurely destroyed if dec_lock() is called on the dialog before
+ * the invite session is created.
+ */
+ pjsip_dlg_inc_session(dlg, &pjsua_var.mod);
+
/* Init media channel */
status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC,
call->secure_level, dlg->pool,
@@ -723,15 +729,10 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
goto on_error;
} else if (status != PJ_EPENDING) {
pjsua_perror(THIS_FILE, "Error initializing media channel", status);
+ pjsip_dlg_dec_session(dlg, &pjsua_var.mod);
goto on_error;
}
- /* Temporarily increment dialog session. Without this, dialog will be
- * prematurely destroyed if dec_lock() is called on the dialog before
- * the invite session is created.
- */
- pjsip_dlg_inc_session(dlg, &pjsua_var.mod);
-
/* Done. */
if (p_call_id)