From 4f82c4d8b37b7594a1870603915c637476a9ba64 Mon Sep 17 00:00:00 2001 From: Sauw Ming Date: Fri, 30 Mar 2012 06:18:50 +0000 Subject: [PATCH] Re #1446 (misc fix): Fix call info to display correct invite state git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3996 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_call.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 4a6f11731..6a4e4dc74 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -1541,7 +1541,13 @@ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id, pj_memcpy(&info->setting, &call->opt, sizeof(call->opt)); /* state, state_text */ - info->state = (call->inv? call->inv->state: PJSIP_INV_STATE_DISCONNECTED); + if (call->inv) { + info->state = call->inv->state; + } else if (call->async_call.dlg) { + info->state = PJSIP_INV_STATE_NULL; + } else { + info->state = PJSIP_INV_STATE_DISCONNECTED; + } info->state_text = pj_str((char*)pjsip_inv_state_name(info->state)); /* If call is disconnected, set the last_status from the cause code */