diff options
author | Liong Sauw Ming <ming@teluu.com> | 2012-10-08 05:23:34 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2012-10-08 05:23:34 +0000 |
commit | 05121265a65a3e65e4d9c476035b1897d2d79005 (patch) | |
tree | 64931ce56b3b59f49b686b4bca6b515e3cce1d72 | |
parent | 49e2ebc27a5b48719de66f860dfd422c8e8b9a77 (diff) |
Fixed #1591: Fixed dialog locking in acquire_call() when media transport is created asynchronously.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4280 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 36bc8985..490561c8 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -1508,6 +1508,7 @@ pj_status_t acquire_call(const char *title, pj_bool_t has_pjsua_lock = PJ_FALSE; pj_status_t status = PJ_SUCCESS; pj_time_val time_start, timeout; + pjsip_dialog *dlg = NULL; pj_gettimeofday(&time_start); timeout.sec = 0; @@ -1535,14 +1536,18 @@ pj_status_t acquire_call(const char *title, has_pjsua_lock = PJ_TRUE; call = &pjsua_var.calls[call_id]; + if (call->inv) + dlg = call->inv->dlg; + else + dlg = call->async_call.dlg; - if (call->inv == NULL) { + if (dlg == NULL) { PJSUA_UNLOCK(); PJ_LOG(3,(THIS_FILE, "Invalid call_id %d in %s", call_id, title)); return PJSIP_ESESSIONTERMINATED; } - status = pjsip_dlg_try_inc_lock(call->inv->dlg); + status = pjsip_dlg_try_inc_lock(dlg); if (status != PJ_SUCCESS) { PJSUA_UNLOCK(); pj_thread_sleep(retry/10); @@ -1567,7 +1572,7 @@ pj_status_t acquire_call(const char *title, } *p_call = call; - *p_dlg = call->inv->dlg; + *p_dlg = dlg; return PJ_SUCCESS; } |