From cd37bec058f821f2777407eb9e99cc561bafdef5 Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Thu, 17 May 2012 16:28:20 +0000 Subject: logger: Adds additional support for call id logging and chan_sip specific stuff This patch improves the handling of call id logging significantly with regard to transfers and adding APIs to better handle specific aspects of logging. Also, changes have been made to chan_sip in order to better handle the creation of callids and to enable the monitor thread to bind itself to a particular call id when a dialog is determined to be related to a callid. It then unbinds itself before returning to normal monitoring. review: https://reviewboard.asterisk.org/r/1886/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/cli.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'main/cli.c') diff --git a/main/cli.c b/main/cli.c index 89bef8023..6c79c7bb2 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1393,6 +1393,8 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar struct ast_str *output;/*!< Accumulation buffer for all output. */ long elapsed_seconds=0; int hour=0, min=0, sec=0; + struct ast_callid *callid; + char call_identifier_str[13] = ""; #ifdef CHANNEL_TRACE int trace_enabled; #endif @@ -1440,6 +1442,12 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar strcpy(cdrtime, "N/A"); } + /* Construct the call identifier string based on the status of the channel's call identifier */ + if ((callid = ast_channel_callid(c))) { + ast_callid_strnprint(call_identifier_str, sizeof(call_identifier_str), callid); + ast_callid_unref(callid); + } + ast_str_append(&output, 0, " -- General --\n" " Name: %s\n" @@ -1474,7 +1482,8 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar " Pickup Group: %llu\n" " Application: %s\n" " Data: %s\n" - " Blocking in: %s\n", + " Blocking in: %s\n" + " Call Identifer: %s\n", ast_channel_name(c), ast_channel_tech(c)->type, ast_channel_uniqueid(c), ast_channel_linkedid(c), S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, "(N/A)"), S_COR(ast_channel_caller(c)->id.name.valid, ast_channel_caller(c)->id.name.str, "(N/A)"), @@ -1497,7 +1506,8 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar cdrtime, ast_channel_internal_bridged_channel(c) ? ast_channel_name(ast_channel_internal_bridged_channel(c)) : "", ast_bridged_channel(c) ? ast_channel_name(ast_bridged_channel(c)) : "", ast_channel_context(c), ast_channel_exten(c), ast_channel_priority(c), ast_channel_callgroup(c), ast_channel_pickupgroup(c), (ast_channel_appl(c) ? ast_channel_appl(c) : "(N/A)" ), (ast_channel_data(c) ? S_OR(ast_channel_data(c), "(Empty)") : "(None)"), - (ast_test_flag(ast_channel_flags(c), AST_FLAG_BLOCKING) ? ast_channel_blockproc(c) : "(Not Blocking)")); + (ast_test_flag(ast_channel_flags(c), AST_FLAG_BLOCKING) ? ast_channel_blockproc(c) : "(Not Blocking)"), + S_OR(call_identifier_str, "(None)")); if (pbx_builtin_serialize_variables(c, &obuf)) { ast_str_append(&output, 0, " Variables:\n%s\n", ast_str_buffer(obuf)); -- cgit v1.2.3