From 88704a49c5ea1bf82109be5a839e7f3eb6939d1c Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 22 May 2012 03:33:04 +0000 Subject: 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 --- pjsip/src/pjsua-lib/pjsua_call.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pjsip/src/pjsua-lib/pjsua_call.c') 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; -- cgit v1.2.3