[asterisk-users] res_odbc.conf and odbc show
Vieri
rentorbuy at yahoo.com
Thu Jul 10 06:11:29 CDT 2008
I have a mixed PBX system with both Asterisk 1.4.21 and 1.2.27 (moving to 1.2.28).
For now I need to keep a few boxes in 1.2 and not migrate them all to 1.4.
However, I would like to have func_odbc and res_odbc on all servers.
On 1.4.21, native func_odbc seems to work fine.
On 1.2.27, the func_odbc backport is giving me an error (I know that this backport is not "officially supported" but the issue I'm reporting is related to res_odbc).
"odbc show" does not display anything in 1.2.27. I'm expecting something like in 1.4.21:
# asterisk -rx "odbc show"
Name: astdb_cluster
DSN: astdb_cluster
Pooled: no
Connected: yes
Reference URLs for func_odbc are:
http://www.asterisk.org/func_odbc
http://svncommunity.digium.com/view/func_odbc/1.2/
The error I'm getting is:
Jul 10 12:07:04 VERBOSE[30281] logger.c: -- Executing Set("SIP/4053-b4410638"
, "ODBC_ASTDB_CLUSTER(voip2|CF/4053)=NULL") in new stack
Jul 10 12:07:04 DEBUG[30281] pbx.c: Function result is 'voip2'
Jul 10 12:07:04 DEBUG[30281] pbx.c: Function result is 'CF/4053'
Jul 10 12:07:04 ERROR[30281] func_odbc.c: Unable to load ODBC write class (check
res_odbc.conf)
func_odbc.conf:
[ASTDB_CLUSTER]
; readhandle=astdb_cluster
; writehandle=astdb_cluster
dsn=astdb_cluster
readsql=SELECT value FROM astdb_cluster WHERE field='${SQL_ESC(${ARG1})}' and host='${SQL_ESC(${ARG2})}'
writesql=INSERT INTO astdb_cluster (host,field,value) VALUES ('${SQL_ESC(${ARG1})}','${SQL_ESC(${ARG2})}',${VALUE})
res_odbc.conf:
[astdb_cluster]
enabled => yes
dsn => astdb_cluster
pre-connect => yes
/etc/unixODBC/odbc.ini:
[astdb_cluster]
Description = MySQL ODBC Driver ASTDB
Driver = MySQL
Socket = /var/run/mysqld/mysqld.sock
Server = localhost
User = xxxxxx
Password = xxxxxx
Database = asteriskcluster
Option = 3
("isql astdb_cluster" works fine even in * 1.2.27 but "asterisk -rx "odbc show"" doesn't)
Thanks
Vieri
More information about the asterisk-users
mailing list