[asterisk-addons-commits] qwell: branch 1.6.0 r570 - in /branches/1.6.0: ./ cdr/ configs/ res/

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Mon Mar 31 15:28:21 CDT 2008


Author: qwell
Date: Mon Mar 31 15:28:21 2008
New Revision: 570

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=570
Log:
Merged revisions 540,545-546,550,554-557,559 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-addons/trunk

................
r540 | qwell | 2008-03-03 11:03:25 -0600 (Mon, 03 Mar 2008) | 13 lines

Merged revisions 539 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-addons/branches/1.4

........
r539 | qwell | 2008-03-03 11:01:57 -0600 (Mon, 03 Mar 2008) | 5 lines

Make sure to create the modules directory.
In some cases, it's possible that this won't already exist.

Closes issue #12111.

........

................
r545 | tilghman | 2008-03-07 09:05:58 -0600 (Fri, 07 Mar 2008) | 10 lines

Blocked revisions 544 via svnmerge

........
r544 | tilghman | 2008-03-07 09:04:06 -0600 (Fri, 07 Mar 2008) | 3 lines

Fix documentation
(Closes issue #12166)

........

................
r546 | russell | 2008-03-11 11:19:30 -0500 (Tue, 11 Mar 2008) | 4 lines

check for a different function to ensure that the version of spandsp is new enough
(closes issue #12181)
(reported by adriavidal, patched by me)

................
r550 | tilghman | 2008-03-12 00:50:55 -0500 (Wed, 12 Mar 2008) | 6 lines

Fix module, based on recent required API change
(closes issue #12189)
 Reported by: IgorG
 Patches: 
       addons_res_mysql.diff uploaded by IgorG (license 20)

................
r554 | tilghman | 2008-03-18 12:43:14 -0500 (Tue, 18 Mar 2008) | 3 lines

When the dbsock is blank, we want to use NULL, not the empty string (which causes MySQL to use the default)
Reported via -dev mailing list, fixed by me.

................
r555 | qwell | 2008-03-18 12:48:23 -0500 (Tue, 18 Mar 2008) | 1 line

Add the same format checking that was added to Asterisk.
................
r556 | qwell | 2008-03-18 12:55:50 -0500 (Tue, 18 Mar 2008) | 1 line

Be more pedantic about format checking, since we can be.
................
r557 | qwell | 2008-03-18 13:06:31 -0500 (Tue, 18 Mar 2008) | 1 line

Switch to menuselect trunk, add targets for newt and curses versions of menuselect
................
r559 | tilghman | 2008-03-18 14:47:56 -0500 (Tue, 18 Mar 2008) | 2 lines

Create a compatibility mode, for people who want the old (incorrect) calldate behavior

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/Makefile
    branches/1.6.0/Makefile.moddir_rules
    branches/1.6.0/cdr/cdr_addon_mysql.c
    branches/1.6.0/configs/cdr_mysql.conf.sample
    branches/1.6.0/configure
    branches/1.6.0/configure.ac
    branches/1.6.0/res/res_config_mysql.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
--- svn:externals (original)
+++ svn:externals Mon Mar 31 15:28:21 2008
@@ -1,1 +1,1 @@
-menuselect	http://svn.digium.com/svn/menuselect/branches/1.0
+menuselect	http://svn.digium.com/svn/menuselect/trunk

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Mon Mar 31 15:28:21 2008
@@ -1,1 +1,1 @@
-/trunk:
+/trunk:540-559

Modified: branches/1.6.0/Makefile
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.0/Makefile?view=diff&rev=570&r1=569&r2=570
==============================================================================
--- branches/1.6.0/Makefile (original)
+++ branches/1.6.0/Makefile Mon Mar 31 15:28:21 2008
@@ -29,7 +29,7 @@
 OVERWRITE:=y
 
 ifeq ($(AST_DEVMODE),yes)
-  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT)
+  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security -Wformat=2
 endif
 
 # If the file .asteriskaddons.makeopts is present in your home directory, you can
@@ -237,22 +237,38 @@
 
 menuconfig: menuselect
 
+cmenuconfig: cmenuselect
+
 gmenuconfig: gmenuselect
+
+nmenuconfig: nmenuselect
 
 menuselect: menuselect/menuselect menuselect-tree
 	- at menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
 
+cmenuselect: menuselect/cmenuselect menuselect-tree
+	- at menuselect/cmenuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
+
 gmenuselect: menuselect/gmenuselect menuselect-tree
 	- at menuselect/gmenuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
 
+nmenuselect: menuselect/nmenuselect menuselect-tree
+	- at menuselect/nmenuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
+
 # options for make in menuselect/
 MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
 
 menuselect/menuselect: menuselect/makeopts
 	$(MAKE_MENUSELECT)
 
+menuselect/cmenuselect: menuselect/makeopts
+	$(MAKE_MENUSELECT) cmenuselect
+
 menuselect/gmenuselect: menuselect/makeopts
 	$(MAKE_MENUSELECT) gmenuselect
+
+menuselect/nmenuselect: menuselect/makeopts
+	$(MAKE_MENUSELECT) nmenuselect
 
 menuselect/makeopts:
 	$(MAKE_MENUSELECT) makeopts

Modified: branches/1.6.0/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.0/Makefile.moddir_rules?view=diff&rev=570&r1=569&r2=570
==============================================================================
--- branches/1.6.0/Makefile.moddir_rules (original)
+++ branches/1.6.0/Makefile.moddir_rules Mon Mar 31 15:28:21 2008
@@ -123,6 +123,7 @@
 
 install:: all
 	@echo "Installing modules from `basename $(CURDIR)`..."
+	@$(INSTALL) -d $(DESTDIR)$(MODULES_DIR)
 	@for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
 
 uninstall::

Modified: branches/1.6.0/cdr/cdr_addon_mysql.c
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.0/cdr/cdr_addon_mysql.c?view=diff&rev=570&r1=569&r2=570
==============================================================================
--- branches/1.6.0/cdr/cdr_addon_mysql.c (original)
+++ branches/1.6.0/cdr/cdr_addon_mysql.c Mon Mar 31 15:28:21 2008
@@ -69,6 +69,7 @@
 static int records = 0;
 static int totalrecords = 0;
 static int timeout = 0;
+static int calldate_compat = 0;
 
 AST_MUTEX_DEFINE_STATIC(mysql_lock);
 
@@ -112,7 +113,7 @@
 		if (dbport)
 			snprintf(status, 255, "Connected to %s@%s, port %d", dbname->str, hostname->str, dbport);
 		else if (dbsock)
-			snprintf(status, 255, "Connected to %s on socket file %s", dbname->str, dbsock->str);
+			snprintf(status, 255, "Connected to %s on socket file %s", dbname->str, S_OR(dbsock->str, "default"));
 		else
 			snprintf(status, 255, "Connected to %s@%s", dbname->str, hostname->str);
 
@@ -180,7 +181,7 @@
 		if (ssl_ca || ssl_cert || ssl_key) {
 			mysql_ssl_set(&mysql, ssl_key ? ssl_key->str : NULL, ssl_cert ? ssl_cert->str : NULL, ssl_ca ? ssl_ca->str : NULL, NULL, NULL);
 		}
-		if (mysql_real_connect(&mysql, hostname->str, dbuser->str, password->str, dbname->str, dbport, dbsock ? dbsock->str : NULL, ssl_ca ? CLIENT_SSL : 0)) {
+		if (mysql_real_connect(&mysql, hostname->str, dbuser->str, password->str, dbname->str, dbport, dbsock && !ast_strlen_zero(dbsock->str) ? dbsock->str : NULL, ssl_ca ? CLIENT_SSL : 0)) {
 			connected = 1;
 			connect_time = time(NULL);
 			records = 0;
@@ -248,7 +249,29 @@
 					break;
 			}
 
-			cdrname = entry ? entry->cdrname : row[0];
+			if (entry) {
+				cdrname = entry->cdrname;
+			} else if (!strcmp(row[0], "calldate")) {
+				/*!\note
+				 * For some dumb reason, "calldate" used to be formulated using
+				 * the datetime the record was posted, rather than the start
+				 * time of the call.  If someone really wants the old compatible
+				 * behavior, it's provided here.
+				 */
+				if (calldate_compat) {
+					struct timeval tv = ast_tvnow();
+					struct ast_tm tm;
+					char timestr[128];
+					ast_localtime(&tv, &tm, NULL);
+					ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %T", &tm);
+					ast_cdr_setvar(cdr, "calldate", timestr, 0);
+					cdrname = "calldate";
+				} else {
+					cdrname = "start";
+				}
+			} else {
+				cdrname = row[0];
+			}
 
 			/* Construct SQL */
 			if (column_count++) {
@@ -411,6 +434,7 @@
 	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 	struct column *entry;
 	char *temp;
+	struct ast_str *compat;
 #if MYSQL_VERSION_ID >= 50013
 	my_bool my_bool_true = 1;
 #endif
@@ -446,6 +470,12 @@
 
 	res |= my_load_config_number(cfg, "global", "port", &dbport, 0);
 	res |= my_load_config_number(cfg, "global", "timeout", &timeout, 0);
+	res |= my_load_config_string(cfg, "global", "compat", &compat, "no");
+	if (ast_true(compat->str)) {
+		calldate_compat = 1;
+	} else {
+		calldate_compat = 0;
+	}
 
 	if (res < 0)
 		return AST_MODULE_LOAD_FAILURE;
@@ -477,6 +507,7 @@
 	ast_debug(1, "Got user of %s\n", dbuser->str);
 	ast_debug(1, "Got dbname of %s\n", dbname->str);
 	ast_debug(1, "Got password of %s\n", password->str);
+	ast_debug(1, "%sunning in calldate compatibility mode\n", calldate_compat ? "R" : "Not r");
 
 	mysql_init(&mysql);
 
@@ -494,7 +525,7 @@
 	if (ssl_ca || ssl_cert || ssl_key) {
 		mysql_ssl_set (&mysql, ssl_key->str, ssl_cert->str, ssl_ca->str, NULL, NULL);
 	}
-	temp = dbsock ? dbsock->str : NULL;
+	temp = dbsock && !ast_strlen_zero(dbsock->str) ? dbsock->str : NULL;
 	if (!mysql_real_connect(&mysql, hostname->str, dbuser->str, password->str, dbname->str, dbport, temp, ssl_ca ? CLIENT_SSL : 0)) {
 		ast_log(LOG_ERROR, "Failed to connect to mysql database %s on %s.\n", dbname->str, hostname->str);
 		connected = 0;

Modified: branches/1.6.0/configs/cdr_mysql.conf.sample
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.0/configs/cdr_mysql.conf.sample?view=diff&rev=570&r1=569&r2=570
==============================================================================
--- branches/1.6.0/configs/cdr_mysql.conf.sample (original)
+++ branches/1.6.0/configs/cdr_mysql.conf.sample Mon Mar 31 15:28:21 2008
@@ -18,6 +18,12 @@
 ;user=asteriskcdruser
 ;port=3306
 ;sock=/tmp/mysql.sock
+;
+; Older versions of cdr_mysql set the calldate field to whenever the
+; record was posted, rather than the start date of the call.  This flag
+; reverts to the old (incorrect) behavior.  Note that you'll also need
+; to comment out the "start=calldate" alias, below, to use this.
+;compat=no
 ;
 ; ssl connections (optional)
 ;ssl_ca=<path to CA cert>

Modified: branches/1.6.0/configure.ac
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.0/configure.ac?view=diff&rev=570&r1=569&r2=570
==============================================================================
--- branches/1.6.0/configure.ac (original)
+++ branches/1.6.0/configure.ac Mon Mar 31 15:28:21 2008
@@ -180,7 +180,7 @@
 AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])
 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
-AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [fax_init], [spandsp.h], [-ltiff])
+AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [span_set_message_handler], [spandsp.h], [-ltiff])
 
 AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
 if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then

Modified: branches/1.6.0/res/res_config_mysql.c
URL: http://svn.digium.com/view/asterisk-addons/branches/1.6.0/res/res_config_mysql.c?view=diff&rev=570&r1=569&r2=570
==============================================================================
--- branches/1.6.0/res/res_config_mysql.c (original)
+++ branches/1.6.0/res/res_config_mysql.c Mon Mar 31 15:28:21 2008
@@ -535,7 +535,7 @@
 	return (int)numrows;
 }
  
-static struct ast_config *config_mysql(const char *database, const char *table, const char *file, struct ast_config *cfg, struct ast_flags config_flags, const char *unused)
+static struct ast_config *config_mysql(const char *database, const char *table, const char *file, struct ast_config *cfg, struct ast_flags config_flags, const char *unused, const char *who_asked)
 {
 	MYSQL_RES *result;
 	MYSQL_ROW row;
@@ -582,7 +582,7 @@
 
 		while ((row = mysql_fetch_row(result))) {
 			if (!strcmp(row[1], "#include")) {
-				if (!ast_config_internal_load(row[2], cfg, config_flags, "")) {
+				if (!ast_config_internal_load(row[2], cfg, config_flags, "", who_asked)) {
 					mysql_free_result(result);
 					ast_mutex_unlock(&dbread.lock);
 					ast_config_destroy(cfg);




More information about the asterisk-addons-commits mailing list