aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-27 06:42:29 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-27 06:42:29 +0000
commit3472d69fa7dcce4707c3a49ad86506d76c167552 (patch)
tree53ef7247988ad592be25adf343e977680369e6bb
parent8d6c048c863c339896931fe09d3c41c745971738 (diff)
Bug 5854 - Allow quotation of the second field in extconfig, for the purpose of including commas (for LDAP configuration)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7647 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--config.c14
-rw-r--r--configs/extconfig.conf.sample2
2 files changed, 14 insertions, 2 deletions
diff --git a/config.c b/config.c
index dda916e20..ce68b60ab 100644
--- a/config.c
+++ b/config.c
@@ -811,9 +811,19 @@ void read_config_maps(void)
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;
diff --git a/configs/extconfig.conf.sample b/configs/extconfig.conf.sample
index 1cf923fb3..1f82b88d7 100644
--- a/configs/extconfig.conf.sample
+++ b/configs/extconfig.conf.sample
@@ -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