[asterisk-commits] jrose: branch jrose/call_identifiers r366844 - in /team/jrose/call_identifier...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 17 11:40:48 CDT 2012


Author: jrose
Date: Thu May 17 11:40:43 2012
New Revision: 366844

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=366844
Log:
automerge stuff

Modified:
    team/jrose/call_identifiers/   (props changed)
    team/jrose/call_identifiers/CHANGES
    team/jrose/call_identifiers/main/channel.c
    team/jrose/call_identifiers/main/cli.c

Propchange: team/jrose/call_identifiers/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 17 11:40:43 2012
@@ -1,1 +1,1 @@
-/trunk:1-366802
+/trunk:1-366843

Modified: team/jrose/call_identifiers/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/jrose/call_identifiers/CHANGES?view=diff&rev=366844&r1=366843&r2=366844
==============================================================================
--- team/jrose/call_identifiers/CHANGES (original)
+++ team/jrose/call_identifiers/CHANGES Thu May 17 11:40:43 2012
@@ -26,7 +26,8 @@
  * Threads belonging to a particular call are now linked with callids which get
    added to any log messages produced by those threads. Log messages can now be
    easily identified as involved with a certain call by looking at their call id.
-   This feature can be disabled in logger.conf with the display_callids option.
+   Call ids may also be attached to log messages for just about any case where
+   it can be determined to be related to a particular call.
  * The minimum DTMF duration can now be configured in asterisk.conf
    as "mindtmfduration". The default value is (as before) set to 80 ms.
    (previously it was only available in source code)

Modified: team/jrose/call_identifiers/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/call_identifiers/main/channel.c?view=diff&rev=366844&r1=366843&r2=366844
==============================================================================
--- team/jrose/call_identifiers/main/channel.c (original)
+++ team/jrose/call_identifiers/main/channel.c Thu May 17 11:40:43 2012
@@ -4201,6 +4201,21 @@
 	return 0;
 }
 
+/*! \brief Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash 
+ * on the given channel */
+static void set_hangupcause_hash(struct ast_channel *chan, const void *data)
+{
+	char causevar[256];
+	const struct ast_control_pvt_cause_code *cause_code = data;
+
+	snprintf(causevar, sizeof(causevar), "HASH(HANGUPCAUSE,%s)", cause_code->chan_name);
+	ast_func_write(chan, causevar, cause_code->code);
+	if (cause_code->emulate_sip_cause) {
+		snprintf(causevar, sizeof(causevar), "HASH(SIP_CAUSE,%s)", cause_code->chan_name);
+		ast_func_write(chan, causevar, cause_code->code);
+	}
+}
+
 int ast_indicate_data(struct ast_channel *chan, int _condition,
 		const void *data, size_t datalen)
 {
@@ -4346,20 +4361,9 @@
 		ts = ast_get_indication_tone(ast_channel_zone(chan), "congestion");
 		break;
 	case AST_CONTROL_PVT_CAUSE_CODE:
-	{
-		char causevar[256];
-		const struct ast_control_pvt_cause_code *cause_code = data;
-
-		snprintf(causevar, sizeof(causevar), "HASH(HANGUPCAUSE,%s)", cause_code->chan_name);
-		ast_func_write(chan, causevar, cause_code->code);
-		if (cause_code->emulate_sip_cause) {
-			snprintf(causevar, sizeof(causevar), "HASH(SIP_CAUSE,%s)", cause_code->chan_name);
-			ast_func_write(chan, causevar, cause_code->code);
-		}
-
+		set_hangupcause_hash(chan, data);
 		res = 0;
 		break;
-	}
 	case AST_CONTROL_PROGRESS:
 	case AST_CONTROL_PROCEEDING:
 	case AST_CONTROL_VIDUPDATE:
@@ -5506,8 +5510,11 @@
 					timeout = 0;		/* trick to force exit from the while() */
 					break;
 
+				case AST_CONTROL_PVT_CAUSE_CODE:
+					set_hangupcause_hash(chan, f->data.ptr);
+					break;
+
 				/* Ignore these */
-				case AST_CONTROL_PVT_CAUSE_CODE:
 				case AST_CONTROL_PROGRESS:
 				case AST_CONTROL_PROCEEDING:
 				case AST_CONTROL_HOLD:

Modified: team/jrose/call_identifiers/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/call_identifiers/main/cli.c?view=diff&rev=366844&r1=366843&r2=366844
==============================================================================
--- team/jrose/call_identifiers/main/cli.c (original)
+++ team/jrose/call_identifiers/main/cli.c Thu May 17 11:40:43 2012
@@ -1394,7 +1394,7 @@
 	long elapsed_seconds=0;
 	int hour=0, min=0, sec=0;
 	struct ast_callid *callid;
-	char call_identifier_str[13];
+	char call_identifier_str[13] = "";
 #ifdef CHANNEL_TRACE
 	int trace_enabled;
 #endif




More information about the asterisk-commits mailing list