aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-02 16:39:56 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-02 16:39:56 +0000
commit2f1f05187636f9c5d5a70dd2e178449db964dfbe (patch)
treea12266321009395725f46731928beee1b4c4d025 /funcs
parentd2a9932b6183473ff832dcbcab1f0592a5155870 (diff)
Backport support for some of the keyword modifications used in 1.6 (while warning that
some options aren't really supported) and add some warning messages. Some credit to oej, who was complaining in #asterisk-dev. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@145839 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_odbc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index 8bc070767..ce25d0fee 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -416,17 +416,21 @@ static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_qu
if ((tmp = ast_variable_retrieve(cfg, catg, "dsn"))) {
ast_copy_string((*query)->dsn, tmp, sizeof((*query)->dsn));
+ } else if ((tmp = ast_variable_retrieve(cfg, catg, "writehandle")) || (tmp = ast_variable_retrieve(cfg, catg, "readhandle"))) {
+ ast_log(LOG_WARNING, "Separate read and write handles are not supported in this version of func_odbc.so\n");
+ ast_copy_string((*query)->dsn, tmp, sizeof((*query)->dsn));
} else {
free(*query);
*query = NULL;
+ ast_log(LOG_ERROR, "No database handle was specified for func_odbc class '%s'\n", catg);
return -1;
}
- if ((tmp = ast_variable_retrieve(cfg, catg, "read"))) {
+ if ((tmp = ast_variable_retrieve(cfg, catg, "read")) || (tmp = ast_variable_retrieve(cfg, catg, "readsql"))) {
ast_copy_string((*query)->sql_read, tmp, sizeof((*query)->sql_read));
}
- if ((tmp = ast_variable_retrieve(cfg, catg, "write"))) {
+ if ((tmp = ast_variable_retrieve(cfg, catg, "write")) || (tmp = ast_variable_retrieve(cfg, catg, "writesql"))) {
ast_copy_string((*query)->sql_write, tmp, sizeof((*query)->sql_write));
}
@@ -491,6 +495,8 @@ static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_qu
"${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.\n"
"This function may only be set.\nSQL:\n%s\n",
(*query)->sql_write);
+ } else {
+ ast_log(LOG_ERROR, "No SQL was found for func_odbc class '%s'\n", catg);
}
/* Could be out of memory, or could be we have neither sql_read nor sql_write */