[asterisk-commits] trunk - r7647 in /trunk: config.c configs/extconfig.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 27 00:42:29 CST 2005


Author: tilghman
Date: Tue Dec 27 00:42:29 2005
New Revision: 7647

URL: http://svn.digium.com/view/asterisk?rev=7647&view=rev
Log:
Bug 5854 - Allow quotation of the second field in extconfig, for the purpose of including commas (for LDAP configuration)

Modified:
    trunk/config.c
    trunk/configs/extconfig.conf.sample

Modified: trunk/config.c
URL: http://svn.digium.com/view/asterisk/trunk/config.c?rev=7647&r1=7646&r2=7647&view=diff
==============================================================================
--- trunk/config.c (original)
+++ trunk/config.c Tue Dec 27 00:42:29 2005
@@ -811,9 +811,19 @@
 	for (v = ast_variable_browse(config, "settings"); v; v = v->next) {
 		stringp = v->value;
 		driver = strsep(&stringp, ",");
-		database = strsep(&stringp, ",");
+
+		/* check if the database text starts with a double quote */
+		if (*stringp == '"') {
+			stringp++;
+			database = strsep(&stringp, "\"");
+			strsep(&stringp, ",");
+		} else {
+			/* apparently this text has no quotes */
+			database = strsep(&stringp, ",");
+		}
+
 		table = strsep(&stringp, ",");
-			
+
 		if (!strcmp(v->name, extconfig_conf)) {
 			ast_log(LOG_WARNING, "Cannot bind '%s'!\n", extconfig_conf);
 			continue;

Modified: trunk/configs/extconfig.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/extconfig.conf.sample?rev=7647&r1=7646&r2=7647&view=diff
==============================================================================
--- trunk/configs/extconfig.conf.sample (original)
+++ trunk/configs/extconfig.conf.sample Tue Dec 27 00:42:29 2005
@@ -40,6 +40,8 @@
 ; the family if the table is not specified
 ;
 ;example => odbc,asterisk,alttable
+;example2 => ldap,"dc=oxymium,dc=net",example2
+;
 ;iaxusers => odbc,asterisk
 ;iaxpeers => odbc,asterisk
 ;sipusers => odbc,asterisk



More information about the asterisk-commits mailing list