<!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&nbsp; incorrect issues the <BR>
sql statement to the config database&nbsp; 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&nbsp;&nbsp;&nbsp; all<BR>
allow&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g729<BR>
allow&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fri Sep 30 04:30:34 2005<BR>
+++ res_config_odbc.c&nbsp;&nbsp; Fri Sep 30 04:31:54 2005<BR>
@@ -460,7 +460,7 @@<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQLBindCol (stmt, 7, SQL_C_CHAR, &amp;var_name, sizeof (var_name), &amp;err);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQLBindCol (stmt, 8, SQL_C_CHAR, &amp;var_val, sizeof (var_val), &amp;err);<BR>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snprintf(sql, sizeof(sql), &quot;SELECT * FROM %s WHERE filename='%s' and commented=0 ORDER BY filename,cat_metric desc,var_metric asc,category,var_name,var_val,id&quot;, table, file);<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snprintf(sql, sizeof(sql), &quot;SELECT * FROM %s WHERE filename='%s' and commented=0 ORDER BY filename,cat_metric desc,var_metric asc,category,id,var_name,var_val&quot;, table, file);<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 &lt;<A HREF="mailto:enigma@lztech.com.br">enigma@lztech.com.br</A>&gt;<BR>
lztech
</TD>
</TR>
</TABLE>
</BODY>
</HTML>