[Asterisk-bsd] Possible fix in the module res/res_odbc
Sergio de Almeida Lenzi
enigma at lztech.com.br
Fri Sep 30 03:12:14 CDT 2005
the module res_config_odbc.c incorrect issues the
sql statement to the config database the idea is
that the order you insert the commands for the config
(sip.conf,iax.conf....)
must be the order the asterisk will read....
for example:
disallow all
allow g729
allow speex
so the field ID is in the wrong place in the select... order by.....
A possible fix follows.....
============================================
--- res_config_odbc.c.orig Fri Sep 30 04:30:34 2005
+++ res_config_odbc.c Fri Sep 30 04:31:54 2005
@@ -460,7 +460,7 @@
SQLBindCol (stmt, 7, SQL_C_CHAR, &var_name, sizeof (var_name),
&err);
SQLBindCol (stmt, 8, SQL_C_CHAR, &var_val, sizeof (var_val),
&err);
- snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE filename='%s'
and commented=0 ORDER BY filename,cat_metric desc,var_metric
asc,category,var_name,var_val,id", table, file);
+ snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE filename='%s'
and commented=0 ORDER BY filename,cat_metric desc,var_metric
asc,category,id,var_name,var_val", table, file);
res = odbc_smart_direct_execute(obj, stmt, sql);
...
--
Sergio de Almeida Lenzi <enigma at lztech.com.br>
lztech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-bsd/attachments/20050930/38f7e7b0/attachment.htm
More information about the Asterisk-BSD
mailing list