From 07bfbcb2b4bb13ee62a02c1312c5f9bdb530e806 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 5 Mar 2006 11:54:56 +0000 Subject: Show call disconnect reason git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@286 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsua/main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'pjsip-apps') diff --git a/pjsip-apps/src/pjsua/main.c b/pjsip-apps/src/pjsua/main.c index 1b0074b4..d9bd3509 100644 --- a/pjsip-apps/src/pjsua/main.c +++ b/pjsip-apps/src/pjsua/main.c @@ -89,11 +89,13 @@ void pjsua_ui_on_call_state(int call_index, pjsip_event *e) PJ_UNUSED_ARG(e); - PJ_LOG(3,(THIS_FILE, "Call %d state changed to %s", - call_index, - pjsua_inv_state_names[call->inv->state])); - if (call->inv->state == PJSIP_INV_STATE_DISCONNECTED) { + + PJ_LOG(3,(THIS_FILE, "Call %d is DISCONNECTED [reason=%d (%s)]", + call_index, + call->inv->cause, + pjsip_get_status_text(call->inv->cause)->ptr)); + call->inv = NULL; if ((int)call->index == current_call) { find_next_call(); @@ -101,6 +103,10 @@ void pjsua_ui_on_call_state(int call_index, pjsip_event *e) } else { + PJ_LOG(3,(THIS_FILE, "Call %d state changed to %s", + call_index, + pjsua_inv_state_names[call->inv->state])); + if (call && current_call==-1) current_call = call->index; @@ -588,7 +594,7 @@ static void ui_console_main(void) } else { /* Hangup current calls */ - pjsua_call_hangup(current_call, PJSIP_SC_DECLINE); + pjsua_call_hangup(current_call); } break; -- cgit v1.2.3