diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-05-22 03:33:04 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-05-22 03:33:04 +0000 |
commit | 88704a49c5ea1bf82109be5a839e7f3eb6939d1c (patch) | |
tree | 4108a32c08f73d15af6dddbc6a4cd9effbcdd2f9 /pjsip/src | |
parent | 243fb6501fcd7bf596040b8cb045c3220864023f (diff) |
Fixed second problem in re #1514: NULL state is reported instead of DISCONNECTED state if call is disconnected due to transport (ICE) initialization error
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4135 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index a6264f3a..5a123c84 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -372,6 +372,17 @@ on_make_call_med_tp_complete(pjsua_call_id call_id, pjsip_dlg_dec_session(dlg, &pjsua_var.mod); if (status != PJ_SUCCESS) { + pj_str_t err_str; + int title_len; + + call->last_code = PJSIP_SC_PRECONDITION_FAILURE; + pj_strcpy2(&call->last_text, "Media init error: "); + + title_len = call->last_text.slen; + err_str = pj_strerror(status, call->last_text_buf_ + title_len, + sizeof(call->last_text_buf_) - title_len); + call->last_text.slen += err_str.slen; + pjsua_perror(THIS_FILE, "Error initializing media channel", status); goto on_error; } @@ -1572,7 +1583,7 @@ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id, /* state, state_text */ if (call->inv) { info->state = call->inv->state; - } else if (call->async_call.dlg) { + } else if (call->async_call.dlg && call->last_code==0) { info->state = PJSIP_INV_STATE_NULL; } else { info->state = PJSIP_INV_STATE_DISCONNECTED; |