I figured it out - it was nothing to do with Informix or unixodbc, but rather with func_odbc.conf and res_odbc.conf. In res_odbc.conf, I had the section titled 'asterisk' and dsn=asterisk-connector. In func_odbc.conf, I had dsn=asterisk-connector, but that isn't right - func_odbc.conf's dsn doesn't point to a unixodbc dsn, but rather to a section in res_odbc.conf, so I changed func_odbc.conf from 'asterisk-connector' to 'asterisk' and everything started working as expected.
________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Justin Killen Sent: Monday, August 22, 2011 10:17 AM To: [email protected] Subject: [asterisk-users] res_odbc with informix Hi, all. I am attempting to get res_odbc working with Informix (server version 11.10.UC1 on an AIX 5.3 box, Informix csdk (client) version: 3.70.UC3DE on a CentOS 6.0 box). I am able to successfully connect and run a query via isql, but if I attempt that same query via the dialplan, I get this error: [Aug 22 09:24:22] ERROR[19020]: func_odbc.c:532 acf_odbc_read: Unable to execute query [SELECT comp_name FROM comp_descr where comp_num = 37] I've enabled unixODBC logging, and I get output during the res_odbc module load, but when the dialplan executes there are no entries generated. I'm running asterisk via 'asterisk -cvvv', and I'm loading res_odbc manually so that I can see the output when the module is loaded - here is the console output for reference: *CLI> module load res_odbc == Parsing '/etc/asterisk/res_odbc.conf': == Found [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:774 load_odbc_config: Adding ENV var: INFORMIXSERVER=borgnet [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:774 load_odbc_config: Adding ENV var: INFORMIXDIR=/opt/IBM/informix [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:774 load_odbc_config: Adding ENV var: ODBCINI=/etc/odbc.ini [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:1479 odbc_obj_connect: Connecting asterisk [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:1509 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector] [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:901 load_odbc_config: Registered ODBC class 'asterisk' dsn->[asterisk-connector] == Registered application 'ODBC_Commit' == Registered application 'ODBC_Rollback' == Registered custom function 'ODBC' [Aug 22 10:15:43] NOTICE[19355]: res_odbc.c:1837 load_module: res_odbc loaded. Loaded res_odbc.so => (ODBC resource) Loaded res_odbc *CLI> module load func_odbc == Registered custom function 'ODBC_FETCH' == Registered application 'ODBCFinish' == Parsing '/etc/asterisk/func_odbc.conf': == Found == Registered custom function 'AAA_COMPNAME' == Registered custom function 'SQL_ESC' Loaded func_odbc.so => (ODBC lookups) Loaded func_odbc Following are some configs: extension.conf (swift is the app for Cepstral): [AAA_37] exten => s,1,Answer exten => s,n,Set(TIMEOUT(digit)=5) exten => s,n,Set(TIMEOUT(response)=10) exten => s,n,Set(COMPNAME=${AAA_COMPNAME(37)}) exten => s,n,Swift(No schedule information available for ${COMPNAME}) exten => s,n,Playback(AAA/5_sec_delay) and from func_odbc.conf: [COMPNAME] dsn=INFORMIX readsql=SELECT comp_name FROM comp_descr where comp_num = ${ARG1} prefix=AAA /etc/odbcinst.ini: [INFORMIX] Driver=/opt/IBM/informix/lib/cli/iclit09b.so Setup=/opt/IBM/informix/lib/cli/iclit09b.so APILevel=1 ConnectFunctions=YYY DriverODBCVer=03.51 FileUsage=0 SQLLevel=1 smProcessPerConnect=Y /etc/odbc.ini: [ODBC Data Sources] asterisk-connector=INFORMIX [asterisk-connector] Driver=INFORMIX Description=INFORMIX connection to asterisk database on borg Database=rmca_test Server=borgnet LogonID=<name> pwd=<password> CLIENT_LOCALE=en_us.8859-1 DB_LOCALE=en_us.8859-1 TRANSLATIONDLL=/opt/IBM/informix/lib/esql/igo4a304.so ; [ODBC] Trace=1 TraceFile=/tmp/odbctrace.out InstallDir=/opt/IBM/informix/lib/cli TRACEDLL=idmrs09a.so Thanks in advance for the help, -Justin
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
