[asterisk-commits] rmudgett: branch rmudgett/hold_retrieve r300157 - in /team/rmudgett/hold_retr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 3 16:35:05 UTC 2011


Author: rmudgett
Date: Mon Jan  3 10:35:00 2011
New Revision: 300157

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=300157
Log:
Merged revisions 300044-300045,300083,300121 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r300044 | tilghman | 2010-12-31 03:21:47 -0600 (Fri, 31 Dec 2010) | 9 lines
  
  Support an alternate configuration file for the 'logger reload' command.
  
  (closes issue #17668)
   Reported by: tilghman
   Patches: 
         20100718__logger_reload_altconf__2.diff.txt uploaded by tilghman (license 14)
   
  Review: (by lmadsen, russell within comments on issue tracker)
................
  r300045 | tilghman | 2010-12-31 03:29:10 -0600 (Fri, 31 Dec 2010) | 8 lines
  
  Support negative filters.
  
  (closes issue #17979)
   Reported by: tilghman
   Patches: 
         20100911__for_blitzrage.diff.txt uploaded by tilghman (license 14)
   Tested by: lmadsen
................
  r300083 | lmadsen | 2011-01-03 07:15:38 -0600 (Mon, 03 Jan 2011) | 17 lines
  
  Merged revisions 300082 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r300082 | lmadsen | 2011-01-03 07:14:25 -0600 (Mon, 03 Jan 2011) | 11 lines
    
    Increase side of mapping response field.
    
    I've increased the size of the response field in a DUNDi mapping because of
    some documentation I'm writing. Previously it was set to AST_MAX_EXTENSION which
    is only 80 characters, which is far too small when you're using some dialplan
    functions to craft a response. The example I'm using is:
    
    extensions =>
    RegisteredDevices,0,SIP,dundi:very_awesome_password/${IF($[${DB_EXISTS(phones/${NUMBER}/device)}]?${DB(phones/${NUMBER}/device)}:None)},nopartial
  ........
................
  r300121 | diruggles | 2011-01-03 08:09:29 -0600 (Mon, 03 Jan 2011) | 13 lines
  
  initialize playing_silence in struct initialization
  
  playing_silence was not initialized with the struct
  was initialized, it was being set after the fact
  which caused problems if something that relied on
  playing_silence being set was called too quickly
  
  (closes issue #18430)
  Reported by: stevebrandli
  Patches: 
        externalivr.patch uploaded by thedavidfactor (license 903)
  Tested by: thedavidfactor, stevebrandli
................

Modified:
    team/rmudgett/hold_retrieve/   (props changed)
    team/rmudgett/hold_retrieve/CHANGES
    team/rmudgett/hold_retrieve/apps/app_externalivr.c
    team/rmudgett/hold_retrieve/cdr/cdr_adaptive_odbc.c
    team/rmudgett/hold_retrieve/configs/cdr_adaptive_odbc.conf.sample
    team/rmudgett/hold_retrieve/main/logger.c
    team/rmudgett/hold_retrieve/pbx/pbx_dundi.c

Propchange: team/rmudgett/hold_retrieve/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/rmudgett/hold_retrieve/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: team/rmudgett/hold_retrieve/
------------------------------------------------------------------------------
--- hold_retrieve-integrated (original)
+++ hold_retrieve-integrated Mon Jan  3 10:35:00 2011
@@ -1,1 +1,1 @@
-/trunk:1-300020
+/trunk:1-300156

Modified: team/rmudgett/hold_retrieve/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hold_retrieve/CHANGES?view=diff&rev=300157&r1=300156&r2=300157
==============================================================================
--- team/rmudgett/hold_retrieve/CHANGES (original)
+++ team/rmudgett/hold_retrieve/CHANGES Mon Jan  3 10:35:00 2011
@@ -26,6 +26,13 @@
 --------------------------
  * New 'gtalk show settings' command showing the current settings loaded from
    gtalk.conf.
+ * The 'logger reload' command now supports an optional argument, specifying an
+   alternate configuration file to use.
+
+CDR
+--------------------------
+ * The filter option in cdr_adaptive_odbc now supports negating the argument,
+   thus allowing records which do NOT match the specified filter.
 
 libpri channel driver (chan_dahdi) DAHDI changes
 --------------------------

Modified: team/rmudgett/hold_retrieve/apps/app_externalivr.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hold_retrieve/apps/app_externalivr.c?view=diff&rev=300157&r1=300156&r2=300157
==============================================================================
--- team/rmudgett/hold_retrieve/apps/app_externalivr.c (original)
+++ team/rmudgett/hold_retrieve/apps/app_externalivr.c Mon Jan  3 10:35:00 2011
@@ -401,6 +401,7 @@
 		.playlist = AST_LIST_HEAD_INIT_VALUE,
 		.finishlist = AST_LIST_HEAD_INIT_VALUE,
 		.gen_active = 0,
+		.playing_silence = 1,
 	};
 	struct ivr_localuser *u = &foo;
 

Modified: team/rmudgett/hold_retrieve/cdr/cdr_adaptive_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hold_retrieve/cdr/cdr_adaptive_odbc.c?view=diff&rev=300157&r1=300156&r2=300157
==============================================================================
--- team/rmudgett/hold_retrieve/cdr/cdr_adaptive_odbc.c (original)
+++ team/rmudgett/hold_retrieve/cdr/cdr_adaptive_odbc.c Mon Jan  3 10:35:00 2011
@@ -65,6 +65,7 @@
 	SQLSMALLINT nullable;
 	SQLINTEGER octetlen;
 	AST_LIST_ENTRY(columns) list;
+	unsigned int negatefiltervalue:1;
 };
 
 struct tables {
@@ -163,9 +164,16 @@
 		/* Check for filters first */
 		for (var = ast_variable_browse(cfg, catg); var; var = var->next) {
 			if (strncmp(var->name, "filter", 6) == 0) {
+				int negate = 0;
 				char *cdrvar = ast_strdupa(var->name + 6);
 				cdrvar = ast_strip(cdrvar);
-				ast_verb(3, "Found filter %s for cdr variable %s in %s@%s\n", var->value, cdrvar, tableptr->table, tableptr->connection);
+				if (cdrvar[strlen(cdrvar) - 1] == '!') {
+					negate = 1;
+					cdrvar[strlen(cdrvar) - 1] = '\0';
+					ast_trim_blanks(cdrvar);
+				}
+
+				ast_verb(3, "Found filter %s'%s' for cdr variable %s in %s@%s\n", negate ? "!" : "", var->value, cdrvar, tableptr->table, tableptr->connection);
 
 				entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(cdrvar) + 1 + strlen(var->value) + 1);
 				if (!entry) {
@@ -180,6 +188,7 @@
 				entry->filtervalue = (char *)entry + sizeof(*entry) + strlen(cdrvar) + 1;
 				strcpy(entry->cdrname, cdrvar);
 				strcpy(entry->filtervalue, var->value);
+				entry->negatefiltervalue = negate;
 
 				AST_LIST_INSERT_TAIL(&(tableptr->columns), entry, list);
 			}
@@ -403,10 +412,11 @@
 				 * is very specifically NOT ast_strlen_zero(), because the filter
 				 * could legitimately specify that the field is blank, which is
 				 * different from the field being unspecified (NULL). */
-				if (entry->filtervalue && strcasecmp(colptr, entry->filtervalue) != 0) {
+				if ((entry->filtervalue && !entry->negatefiltervalue && strcasecmp(colptr, entry->filtervalue) != 0) ||
+					(entry->filtervalue && entry->negatefiltervalue && strcasecmp(colptr, entry->filtervalue) == 0)) {
 					ast_verb(4, "CDR column '%s' with value '%s' does not match filter of"
-						" '%s'.  Cancelling this CDR.\n",
-						entry->cdrname, colptr, entry->filtervalue);
+						" %s'%s'.  Cancelling this CDR.\n",
+						entry->cdrname, colptr, entry->negatefiltervalue ? "!" : "", entry->filtervalue);
 					goto early_release;
 				}
 

Modified: team/rmudgett/hold_retrieve/configs/cdr_adaptive_odbc.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hold_retrieve/configs/cdr_adaptive_odbc.conf.sample?view=diff&rev=300157&r1=300156&r2=300157
==============================================================================
--- team/rmudgett/hold_retrieve/configs/cdr_adaptive_odbc.conf.sample (original)
+++ team/rmudgett/hold_retrieve/configs/cdr_adaptive_odbc.conf.sample Mon Jan  3 10:35:00 2011
@@ -37,6 +37,8 @@
 ; Any filter specified MUST match exactly or the CDR will be discarded
 ;filter accountcode => somename
 ;filter src => 123
+; Negative filters are also now available
+;filter src != 456
 ;
 ; Additionally, we now support setting static values per column.  Reason
 ; for this is to allow different sections to specify different values for

Modified: team/rmudgett/hold_retrieve/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hold_retrieve/main/logger.c?view=diff&rev=300157&r1=300156&r2=300157
==============================================================================
--- team/rmudgett/hold_retrieve/main/logger.c (original)
+++ team/rmudgett/hold_retrieve/main/logger.c Mon Jan  3 10:35:00 2011
@@ -283,7 +283,7 @@
 	return chan;
 }
 
-static void init_logger_chain(int locked)
+static void init_logger_chain(int locked, const char *altconf)
 {
 	struct logchannel *chan;
 	struct ast_config *cfg;
@@ -291,7 +291,7 @@
 	const char *s;
 	struct ast_flags config_flags = { 0 };
 
-	if (!(cfg = ast_config_load2("logger.conf", "logger", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) {
+	if (!(cfg = ast_config_load2(S_OR(altconf, "logger.conf"), "logger", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) {
 		return;
 	}
 
@@ -616,7 +616,7 @@
 	return res;
 }
 
-static int reload_logger(int rotate)
+static int reload_logger(int rotate, const char *altconf)
 {
 	char old[PATH_MAX] = "";
 	int queue_rotate = rotate;
@@ -665,7 +665,7 @@
 
 	filesize_reload_needed = 0;
 
-	init_logger_chain(1 /* locked */);
+	init_logger_chain(1 /* locked */, altconf);
 
 	if (logfiles.queue_log) {
 		do {
@@ -716,7 +716,7 @@
 	a full Asterisk reload) */
 int logger_reload(void)
 {
-	if (reload_logger(0)) {
+	if (reload_logger(0, NULL)) {
 		return RESULT_FAILURE;
 	}
 	return RESULT_SUCCESS;
@@ -727,14 +727,14 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "logger reload";
-		e->usage = 
-			"Usage: logger reload\n"
+		e->usage =
+			"Usage: logger reload [<alt-conf>]\n"
 			"       Reloads the logger subsystem state.  Use after restarting syslogd(8) if you are using syslog logging.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (reload_logger(0)) {
+	if (reload_logger(0, a->argc == 3 ? a->argv[2] : NULL)) {
 		ast_cli(a->fd, "Failed to reload the logger\n");
 		return CLI_FAILURE;
 	}
@@ -753,7 +753,7 @@
 	case CLI_GENERATE:
 		return NULL;	
 	}
-	if (reload_logger(1)) {
+	if (reload_logger(1, NULL)) {
 		ast_cli(a->fd, "Failed to reload the logger and rotate log files\n");
 		return CLI_FAILURE;
 	} 
@@ -966,7 +966,7 @@
 
 	/* If we need to reload because of the file size, then do so */
 	if (filesize_reload_needed) {
-		reload_logger(-1);
+		reload_logger(-1, NULL);
 		ast_verb(1, "Rotated Logs Per SIGXFSZ (Exceeded file size limit)\n");
 	}
 
@@ -1048,7 +1048,7 @@
 	ast_mkdir(ast_config_AST_LOG_DIR, 0777);
 
 	/* create log channels */
-	init_logger_chain(0 /* locked */);
+	init_logger_chain(0 /* locked */, NULL);
 
 	return 0;
 }

Modified: team/rmudgett/hold_retrieve/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hold_retrieve/pbx/pbx_dundi.c?view=diff&rev=300157&r1=300156&r2=300157
==============================================================================
--- team/rmudgett/hold_retrieve/pbx/pbx_dundi.c (original)
+++ team/rmudgett/hold_retrieve/pbx/pbx_dundi.c Mon Jan  3 10:35:00 2011
@@ -286,7 +286,7 @@
 	int options;
 	int tech;
 	int dead;
-	char dest[AST_MAX_EXTENSION];
+	char dest[512];
 	AST_LIST_ENTRY(dundi_mapping) list;
 };
 




More information about the asterisk-commits mailing list