[asterisk-commits] seanbright: trunk r202887 - in /trunk: cdr/cdr_tds.c configs/cdr_tds.conf.sample

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 24 08:47:59 CDT 2009


Author: seanbright
Date: Wed Jun 24 08:47:55 2009
New Revision: 202887

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202887
Log:
Update sample cdr_tds configuration to try and eliminate some confusion.

Also change the preferred configuration option from 'hostname' (which was
misleading because it didn't actually treat the value as a hostname) to
'connection' and added some verbage explaining that the user would need to
refer to their freetds.conf file for those settings.  'hostname' was kept
as a backwards compatible configuration parameter.

Modified:
    trunk/cdr/cdr_tds.c
    trunk/configs/cdr_tds.conf.sample

Modified: trunk/cdr/cdr_tds.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/cdr/cdr_tds.c?view=diff&rev=202887&r1=202886&r2=202887
==============================================================================
--- trunk/cdr/cdr_tds.c (original)
+++ trunk/cdr/cdr_tds.c Wed Jun 24 08:47:55 2009
@@ -443,12 +443,19 @@
 	/* Clear out any existing settings */
 	ast_string_field_init(settings, 0);
 
-	ptr = ast_variable_retrieve(cfg, "global", "hostname");
+	/* 'connection' is the new preferred configuration option */
+	ptr = ast_variable_retrieve(cfg, "global", "connection");
 	if (ptr) {
 		ast_string_field_set(settings, hostname, ptr);
 	} else {
-		ast_log(LOG_ERROR, "Failed to connect: Database server hostname not specified.\n");
-		goto failed;
+		/* But we keep 'hostname' for backwards compatibility */
+		ptr = ast_variable_retrieve(cfg, "global", "hostname");
+		if (ptr) {
+			ast_string_field_set(settings, hostname, ptr);
+		} else {
+			ast_log(LOG_ERROR, "Failed to connect: Database server connection not specified.\n");
+			goto failed;
+		}
 	}
 
 	ptr = ast_variable_retrieve(cfg, "global", "dbname");

Modified: trunk/configs/cdr_tds.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/configs/cdr_tds.conf.sample?view=diff&rev=202887&r1=202886&r2=202887
==============================================================================
--- trunk/configs/cdr_tds.conf.sample (original)
+++ trunk/configs/cdr_tds.conf.sample Wed Jun 24 08:47:55 2009
@@ -1,10 +1,67 @@
-; Sample Asterisk config file for CDR logging to FreeTDS
+;
+; Asterisk Call Detail Records (CDR) - FreeTDS Backend
+;
 
 ;[global]
-;hostname=fs.malico.loc
-;dbname=MalicoHN
-;user=mangUsr
-;password=
-;charset=BIG5
+
+; Connection
+;
+; Use the 'connection' keyword to specify one of the instance names from your
+; 'freetds.conf' file.  Note that 'freetds.conf' is not an Asterisk
+; configuration file, but one specific to the FreeTDS library.  See the FreeTDS
+; documentation on 'freetds.conf' for more information:
+;
+;         http://www.freetds.org/userguide/freetdsconf.htm
+;
+; Accepted values: One of the connections specified in freetds.conf
+
+;connection=ConnectionFromFreeTDSConf
+
+; Database Name
+;
+; The 'dbname' keyword specifies the database name to use when logging CDRs.
+;
+; Accepted values: Any valid database name
+
+;dbname=AsteriskCDRs
+
+; Database Table Name
+;
+; The 'table' keyword identifies which database table is used to log CDRs.
+;
+; Accepted value: Any valid table name
+; Default value:  If not specified, a table named 'cdr' is assumed
+
 ;table=cdr
 
+; Credentials
+;
+; The 'username' and 'password' keywords specify the user credentials that
+; Asterisk should use when connecting to the database.
+;
+; Accepted value: Any valid username and password
+
+;username=mangUsr
+;password=
+
+; Language
+;
+; The 'language' keyword changes the language which are used for error and
+; information messages returned by SQL Server.  Each database and user has their
+; own default value, and this default can be overriden here.
+;
+; Accepted value: Any language installed on the target SQL Server.
+; Default value:  us_english
+
+;language=us_english
+
+; Character Set
+;
+; The 'charset' setting is used to change the character set used when connecting
+; to the database server.  Each database and database user has their own
+; character set setting, and this default can be overriden here.
+;
+; Accepted value: Any valid character set available on the target SQL server.
+; Default value:  iso_1
+
+;charset=BIG5




More information about the asterisk-commits mailing list