<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.6.1">
</HEAD>
<BODY>
the module res_config_odbc.c incorrect issues the <BR>
sql statement to the config database the idea is<BR>
that the order you insert the commands for the config (sip.conf,iax.conf....)<BR>
must be the order the asterisk will read....<BR>
for example:<BR>
disallow all<BR>
allow g729<BR>
allow speex<BR>
<BR>
so the field ID is in the wrong place in the select... order by.....<BR>
<BR>
A possible fix follows.....<BR>
<BR>
============================================<BR>
<BR>
<BR>
--- res_config_odbc.c.orig Fri Sep 30 04:30:34 2005<BR>
+++ res_config_odbc.c Fri Sep 30 04:31:54 2005<BR>
@@ -460,7 +460,7 @@<BR>
SQLBindCol (stmt, 7, SQL_C_CHAR, &var_name, sizeof (var_name), &err);<BR>
SQLBindCol (stmt, 8, SQL_C_CHAR, &var_val, sizeof (var_val), &err);<BR>
<BR>
- 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);<BR>
+ 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);<BR>
<BR>
res = odbc_smart_direct_execute(obj, stmt, sql);<BR>
<BR>
<BR>
<BR>
<BR>
<FONT COLOR="#000000">...</FONT><BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Sergio de Almeida Lenzi <<A HREF="mailto:enigma@lztech.com.br">enigma@lztech.com.br</A>><BR>
lztech
</TD>
</TR>
</TABLE>
</BODY>
</HTML>