[asterisk-commits] rmudgett: trunk r350605 - in /trunk: ./ cel/ configs/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 13 11:36:46 CST 2012


Author: rmudgett
Date: Fri Jan 13 11:36:44 2012
New Revision: 350605

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=350605
Log:
Add missing CEL logging fields to various CEL backends.

Multiple revisions 350555,350571

........
  r350555 | rmudgett | 2012-01-13 11:12:51 -0600 (Fri, 13 Jan 2012) | 12 lines
  
  Add missing CEL logging fields to various CEL backends.
  
  * Add missing eventextra to cel_psql.c and cel_odbc.c.
  
  * Add missing PeerAccount and EventExtra to cel_manager.c.
  
  * Add missing userdeftype support for cel_custom.conf.sample and
  cel_sqlite3_custom.conf.sample.
  
  (closes issue ASTERISK-17190)
  Reported by: Bryant Zimmerman
........
  r350571 | rmudgett | 2012-01-13 11:23:57 -0600 (Fri, 13 Jan 2012) | 8 lines
  
  Use compatible names for event extra data for various CEL backends.
  
  * Change eventextra to extra in cel_psql.c and cel_odbc.c.
  
  * Change EventExtra to Extra in cel_manager.c.
  
  (issue ASTERISK-17190)
........

Merged revisions 350555,350571 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 350585 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/cel/cel_manager.c
    trunk/cel/cel_odbc.c
    trunk/configs/cel.conf.sample
    trunk/configs/cel_custom.conf.sample
    trunk/configs/cel_odbc.conf.sample
    trunk/configs/cel_pgsql.conf.sample
    trunk/configs/cel_sqlite3_custom.conf.sample
    trunk/main/cel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/cel/cel_manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cel/cel_manager.c?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/cel/cel_manager.c (original)
+++ trunk/cel/cel_manager.c Fri Jan 13 11:36:44 2012
@@ -61,11 +61,11 @@
 		.version = AST_CEL_EVENT_RECORD_VERSION,
 	};
 
-	if (ast_cel_fill_record(event, &record)) {
+	if (!enablecel) {
 		return;
 	}
 
-	if (!enablecel) {
+	if (ast_cel_fill_record(event, &record)) {
 		return;
 	}
 
@@ -90,13 +90,29 @@
 		"UniqueID: %s\r\n"
 		"LinkedID: %s\r\n"
 		"Userfield: %s\r\n"
-		"Peer: %s\r\n",
-		record.event_name, record.account_code, record.caller_id_num,
-		record.caller_id_name, record.caller_id_ani, record.caller_id_rdnis,
-		record.caller_id_dnid, record.extension, record.context, record.channel_name,
-		record.application_name, record.application_data, start_time,
-		ast_cel_get_ama_flag_name(record.amaflag), record.unique_id, record.linked_id,
-		record.user_field, record.peer);
+		"Peer: %s\r\n"
+		"PeerAccount: %s\r\n"
+		"Extra: %s\r\n",
+		record.event_name,
+		record.account_code,
+		record.caller_id_num,
+		record.caller_id_name,
+		record.caller_id_ani,
+		record.caller_id_rdnis,
+		record.caller_id_dnid,
+		record.extension,
+		record.context,
+		record.channel_name,
+		record.application_name,
+		record.application_data,
+		start_time,
+		ast_cel_get_ama_flag_name(record.amaflag),
+		record.unique_id,
+		record.linked_id,
+		record.user_field,
+		record.peer,
+		record.peer_account,
+		record.extra);
 }
 
 static int load_config(int reload)

Modified: trunk/cel/cel_odbc.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cel/cel_odbc.c?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/cel/cel_odbc.c (original)
+++ trunk/cel/cel_odbc.c Fri Jan 13 11:36:44 2012
@@ -438,6 +438,8 @@
 					ast_copy_string(colbuf, record.peer, sizeof(colbuf));
 				} else if (strcmp(entry->celname, "amaflags") == 0) {
 					snprintf(colbuf, sizeof(colbuf), "%d", record.amaflag);
+				} else if (strcmp(entry->celname, "extra") == 0) {
+					ast_copy_string(colbuf, record.extra, sizeof(colbuf));
 				} else {
 					colbuf[0] = 0;
 				}

Modified: trunk/configs/cel.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/cel.conf.sample?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/configs/cel.conf.sample (original)
+++ trunk/configs/cel.conf.sample Fri Jan 13 11:36:44 2012
@@ -56,13 +56,17 @@
 ;  PARK_END         -- Unpark event
 ;  BRIDGE_START     -- The time a bridge is started
 ;  BRIDGE_END       -- The time a bridge is ended
-;  3WAY_START       -- When a 3-way conference starts (usually via attended xfer)
+;  BRIDGE_UPDATE    -- This is a replacement channel (Masquerade)
+;  3WAY_START       -- When a 3-way conference starts (usually via attended transfer)
 ;  3WAY_END         -- When one or all exit a 3-way conference
 ;  BLINDTRANSFER    -- When a blind transfer is initiated
 ;  ATTENDEDTRANSFER -- When an attended transfer is initiated
 ;  TRANSFER         -- Generic transfer initiated; not used yet...?
+;  PICKUP           -- This channel picked up the peer channel
+;  FORWARD          -- This channel is being forwarded somewhere else
 ;  HOOKFLASH        -- So far, when a hookflash event occurs on a DAHDI
 ;                      interface
+;  LINKEDID_END     -- The last channel with the given linkedid is retired
 ;  USER_DEFINED     -- Triggered from the dialplan, and has a name given by the
 ;                      user
 ;

Modified: trunk/configs/cel_custom.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/cel_custom.conf.sample?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/configs/cel_custom.conf.sample (original)
+++ trunk/configs/cel_custom.conf.sample Fri Jan 13 11:36:44 2012
@@ -22,10 +22,13 @@
 ; details from the CEL event.  There are also a few variables created by this
 ; module that can be used in a mapping:
 ;
-;    eventtype  - The name of the CEL event.
-;    eventtime  - The timestamp of the CEL event.
-;    eventextra - Extra data included with this CEL event, typically along with
-;                 an event of type USER_DEFINED from CELGenUserEvent().
+;    eventtype   - The name of the CEL event.
+;    eventtime   - The timestamp of the CEL event.
+;    userdeftype - User defined event type name from CELGenUserEvent().
+;    eventextra  - Extra data included with this CEL event, typically along with
+;                  an event of type USER_DEFINED from CELGenUserEvent().
+;    BRIDGEPEER  - Bridged peer channel name at the time of the CEL event.
+;                  CHANNEL(peer) could also be used.
 ;
 [mappings]
-;Master.csv => ${CSV_QUOTE(${eventtype})},${CSV_QUOTE(${eventtime})},${CSV_QUOTE(${CALLERID(name)})},${CSV_QUOTE(${CALLERID(num)})},${CSV_QUOTE(${CALLERID(ANI)})},${CSV_QUOTE(${CALLERID(RDNIS)})},${CSV_QUOTE(${CALLERID(DNID)})},${CSV_QUOTE(${CHANNEL(exten)})},${CSV_QUOTE(${CHANNEL(context)})},${CSV_QUOTE(${CHANNEL(channame)})},${CSV_QUOTE(${CHANNEL(appname)})},${CSV_QUOTE(${CHANNEL(appdata)})},${CSV_QUOTE(${CHANNEL(amaflags)})},${CSV_QUOTE(${CHANNEL(accountcode)})},${CSV_QUOTE(${CHANNEL(uniqueid)})},${CSV_QUOTE(${CHANNEL(linkedid)})},${CSV_QUOTE(${CHANNEL(peer)})},${CSV_QUOTE(${CHANNEL(userfield)})},${CSV_QUOTE(${eventextra})}
+;Master.csv => ${CSV_QUOTE(${eventtype})},${CSV_QUOTE(${eventtime})},${CSV_QUOTE(${CALLERID(name)})},${CSV_QUOTE(${CALLERID(num)})},${CSV_QUOTE(${CALLERID(ANI)})},${CSV_QUOTE(${CALLERID(RDNIS)})},${CSV_QUOTE(${CALLERID(DNID)})},${CSV_QUOTE(${CHANNEL(exten)})},${CSV_QUOTE(${CHANNEL(context)})},${CSV_QUOTE(${CHANNEL(channame)})},${CSV_QUOTE(${CHANNEL(appname)})},${CSV_QUOTE(${CHANNEL(appdata)})},${CSV_QUOTE(${CHANNEL(amaflags)})},${CSV_QUOTE(${CHANNEL(accountcode)})},${CSV_QUOTE(${CHANNEL(uniqueid)})},${CSV_QUOTE(${CHANNEL(linkedid)})},${CSV_QUOTE(${BRIDGEPEER})},${CSV_QUOTE(${CHANNEL(userfield)})},${CSV_QUOTE(${userdeftype})},${CSV_QUOTE(${eventextra})}

Modified: trunk/configs/cel_odbc.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/cel_odbc.conf.sample?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/configs/cel_odbc.conf.sample (original)
+++ trunk/configs/cel_odbc.conf.sample Fri Jan 13 11:36:44 2012
@@ -64,6 +64,7 @@
 ;	amaflags  (an int)
 ;	userfield
 ;	peer
+;	extra
 
 ; The point of this module is to allow you log whatever you like in terms of the
 ; CEL variables.  Do you want to log uniqueid?  Then simply ensure that your

Modified: trunk/configs/cel_pgsql.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/cel_pgsql.conf.sample?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/configs/cel_pgsql.conf.sample (original)
+++ trunk/configs/cel_pgsql.conf.sample Fri Jan 13 11:36:44 2012
@@ -48,7 +48,7 @@
 ;	peeraccount
 ;	uniqueid
 ;	linkedid
-;	amaflag  (an int)
+;	amaflags  (an int)
 ;	userfield
 ;	peer
 ;	extra

Modified: trunk/configs/cel_sqlite3_custom.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/cel_sqlite3_custom.conf.sample?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/configs/cel_sqlite3_custom.conf.sample (original)
+++ trunk/configs/cel_sqlite3_custom.conf.sample Fri Jan 13 11:36:44 2012
@@ -5,7 +5,19 @@
 ;
 ; Mappings for sqlite3 config file
 ;
+; Within a mapping, use the CALLERID() and CHANNEL() functions to retrieve
+; details from the CEL event.  There are also a few variables created by this
+; module that can be used in a mapping:
+;
+;    eventtype   - The name of the CEL event.
+;    eventtime   - The timestamp of the CEL event.
+;    userdeftype - User defined event type name from CELGenUserEvent().
+;    eventextra  - Extra data included with this CEL event, typically along with
+;                  an event of type USER_DEFINED from CELGenUserEvent().
+;    BRIDGEPEER  - Bridged peer channel name at the time of the CEL event.
+;                  CHANNEL(peer) could also be used.
+;
 ;[master] ; currently, only file "master.db" is supported, with only one table at a time.
 ;table	=> cel
-;columns	=> eventtype, eventtime, cidname, cidnum, cidani, cidrdnis, ciddnid, context, exten, channame, appname, appdata, amaflags, accountcode, uniqueid, userfield, peer
-;values	=> '${eventtype}','${eventtime}','${CALLERID(name)}','${CALLERID(num)}','${CALLERID(ANI)}','${CALLERID(RDNIS)}','${CALLERID(DNID)}','${CHANNEL(context)}','${CHANNEL(exten)}','${CHANNEL(channame)}','${CHANNEL(appname)}','${CHANNEL(appdata)}','${CHANNEL(amaflags)}','${CHANNEL(accountcode)}','${CHANNEL(uniqueid)}','${CHANNEL(userfield)}','${CHANNEL(peer)}'
+;columns	=> eventtype, eventtime, cidname, cidnum, cidani, cidrdnis, ciddnid, context, exten, channame, appname, appdata, amaflags, accountcode, uniqueid, userfield, peer, userdeftype, eventextra
+;values	=> '${eventtype}','${eventtime}','${CALLERID(name)}','${CALLERID(num)}','${CALLERID(ANI)}','${CALLERID(RDNIS)}','${CALLERID(DNID)}','${CHANNEL(context)}','${CHANNEL(exten)}','${CHANNEL(channame)}','${CHANNEL(appname)}','${CHANNEL(appdata)}','${CHANNEL(amaflags)}','${CHANNEL(accountcode)}','${CHANNEL(uniqueid)}','${CHANNEL(userfield)}','${BRIDGEPEER}','${userdeftype}','${eventextra}'

Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=350605&r1=350604&r2=350605
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Fri Jan 13 11:36:44 2012
@@ -47,7 +47,7 @@
 static unsigned char cel_enabled;
 
 /*! \brief CEL is off by default */
-static const unsigned char CEL_ENALBED_DEFAULT = 0;
+#define CEL_ENABLED_DEFAULT		0
 
 /*! 
  * \brief which events we want to track 
@@ -65,12 +65,12 @@
 /*! 
  * \brief Track no events by default.
  */
-static const int64_t CEL_DEFAULT_EVENTS = 0;
+#define CEL_DEFAULT_EVENTS	0
 
 /*!
  * \brief Number of buckets for the appset container
  */
-static const int NUM_APP_BUCKETS = 97;
+#define NUM_APP_BUCKETS		97
 
 /*!
  * \brief Container of Asterisk application names
@@ -298,7 +298,7 @@
 	ast_mutex_lock(&reload_lock);
 
 	/* Reset all settings before reloading configuration */
-	cel_enabled = CEL_ENALBED_DEFAULT;
+	cel_enabled = CEL_ENABLED_DEFAULT;
 	eventset = CEL_DEFAULT_EVENTS;
 	*cel_dateformat = '\0';
 	ao2_callback(appset, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
@@ -439,6 +439,9 @@
 		AST_LIST_INSERT_HEAD(headp, newvariable, entries);
 	}
 
+	if ((newvariable = ast_var_assign("userdeftype", record.user_defined_name))) {
+		AST_LIST_INSERT_HEAD(headp, newvariable, entries);
+	}
 	if ((newvariable = ast_var_assign("eventextra", record.extra))) {
 		AST_LIST_INSERT_HEAD(headp, newvariable, entries);
 	}




More information about the asterisk-commits mailing list