[Asterisk-Users] Help With Configuration From Odbc

Arthur B Olsen maillists at teletech.fo
Fri Dec 31 19:30:03 MST 2004


Hi. I can't figure this one out. Hope someone can help me.

root at pbx:# cat /etc/odbc.ini 
 
[Asterisk] 
Description=PostgreSQL asterisk 
Driver=PostgreSQL 
Trace=No 
TraceFile=/tmp/odbc.log 
Database=asterisk 
ServerName=localhost 
UserName=XXXX
Password=XXXX 
Port=5432 
Protocol=7.4 
ReadOnly=No 
RowVersioning=No 
ShowSystemTables=Yes 
ShowOidColumn=Yes 
FakeOidIndex=Yes 
ConnSettings= 
 
root at pbx:# cat /etc/odbcinst.ini 
[PostgreSQL] 
Description=PostgreSQL ODBC driver for Linux and Windows 
Driver=/usr/local/lib/psqlodbc.so 
Setup=/usr/lib/odbc/libodbcpsqlS.so 
Debug = 1 
CommLog = 1 
 
 
root at pbx:# echo "select * from ast_config where filename='iax.conf' and commented=0 order by filename,cat_metric desc,var_metric asc,category,var_name,var_val,id" | isql Asterisk 
 
<lot of output from table> 
 
SQLRowCount returns 39 
39 rows fetched 

So the odbc thingy works!
 
 
root at pbx:# cat res_config_odbc.conf 
[settings] 
table = ast_config 
connection = myconn 
 
root at pbx:# cat res_odbc.conf 
[myconn] 
dsn=Asterisk 
username=XXXXX 
password=XXXXX 
preconnect=yes 

root at pbx:# cat extconfig.conf
[settings]
agents.conf => odbc
enum.conf => odbc
extensions.conf => odbc
iax.conf => odbc
iaxprov.conf => odbc
queues.conf => odbc
sip.conf => odbc
zapata.conf => odbc

 
 
And asterisk answers: 


 [res_odbc.so] => (ODBC Resource)
  == Parsing '/etc/asterisk/res_odbc.conf': Found
Jan  1 02:21:11 NOTICE[32024]: res_odbc.c:133 load_odbc_config: registered database handle 'myconn' dsn->[Asterisk]
Jan  1 02:21:11 NOTICE[32024]: res_odbc.c:379 load_module: res_odbc loaded.
 [res_config_odbc.so] => (ODBC Configuration)
Jan  1 02:21:11 NOTICE[32024]: config.c:888 ast_config_register: Registered Config Engine odbc
  == Parsing '/etc/asterisk/extconfig.conf': Found
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: agents.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: enum.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: extensions.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: iax.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: iaxprov.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: queues.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: sip.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: config.c:1092 read_ast_cust_config: Binding: zapata.conf to odbc
Jan  1 02:21:11 NOTICE[32024]: res_config_odbc.c:190 load_module: res_config_odbc loaded.
 [skipping res_adsi.so]
 [skipping chan_modem.so]
 [chan_sip.so] => (Session Initiation Protocol (SIP))
Jan  1 02:21:11 NOTICE[32024]: config.c:764 __ast_load: Loading Config sip.conf via odbc engine
  == Parsing '/etc/asterisk/res_config_odbc.conf': Found
Jan  1 02:21:11 WARNING[32024]: res_config_odbc.c:103 config_odbc: SQL select error!
[select * from ast_config where filename='sip.conf' and commented=0 order by filename,cat_metric desc,var_metric asc,category,var_name,var_val,id]


What is wrong?



More information about the asterisk-users mailing list