[Home]

Summary:ASTERISK-15950: Connection Problem with UnixODBC 2.1.14
Reporter:David Sharon (davidsharon)Labels:
Date Opened:2010-04-13 03:16:04Date Closed:2011-06-07 14:00:59
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:
I upgraded UnixODBC version to 2.2.14.

After installation and configuration, I tried iSql (the new release) for Oracle 11g. It works without any problem: it can connect and execute SQL commands.

On Asterisk side, in func_odbc.conf,

[BLACKLIST]
dsn=oracle
; oracle is defined in odbc.ini as dsn. it works with isql.
readsql = SELECT count(*) as Say FROM Blacklist where CallerId = '${SQL_ESC(${ARG1})}';

In extensions.conf, we have a voicemenu scenario:

...
[voicemenu-custom-7661]
include = default
exten = s,1,NoOp(IVR_BlackList)
exten = s,2,Answer()
exten = s,3,Set(ARG1=${CALLERID(name)})
exten = s,4,Set(Result=${ODBC_BLACKLIST(${ARG1})})
exten = s,5,GotoIf(${Result}=1?0:)
exten = s,6,Playback(dir-welcome)
exten = s,7,Goto(queues,6500,1)  
...

When this context is executed, res_odbc raises an exception and Asterisk is stopped.

After checking out the log files and the source code, I realized that we might have a library-related problem.

Could you please check this case and advise us how to fix it?

Thank you in advance,

David

P.S. Upgrading our Asterisk to 1.6.18 didn't solve this issue.

****** ADDITIONAL INFORMATION ******

Error message on CLI:

==26320== by 0x490B320: ast_odbc_prepare_and_execute (res_odbc.c:114) SQLFreeHandle(SQL_BLACKLIST stmt);
==26320== by 0x469266A: ??? (res_config_odbc.c:396) stmt = ast_odbc_prepare_and_execute(obj, custom_prepare, &cps);
Comments:By: Leif Madsen (lmadsen) 2010-04-13 13:21:12

Which version worked before? I'm presuming a version before the upgrade was working, and now upgrading has caused it to not work?

Are your odbc.ini and odbcinst.ini files configured correctly and pointing to the right modules? Can you upload them and show us that they are? (That probably means showing the contents of the appropriate lib/ directory as well.)

Can you show us a backtrace if Asterisk is crashing? The lines you've provided I don't think tell us very much.

Thanks!



By: David Sharon (davidsharon) 2010-04-14 02:50:15

The previous version is 1.6.1.12.

Before upgrade, it was NOT working. Assuming that this was a library-related problem, we thought that upgrading the Asterisk would solve this situation. But it persists.

odbc.ini and odbcinst.ini are configured correctly and referencing to right modules. When I use iSql, there is no problem: I can connect and execute SQL commands over iSQL.

Sure, I will share our config files and logs.

By: Leif Madsen (lmadsen) 2010-04-15 12:19:44

This is starting to sound like an issue with the libraries installed, or something configured incorrectly. I've done a lot of ODBC integration testing, and I haven't run into anything like this before.

Simply upgrading Asterisk is unlikely to resolve your problem. I have a strong feeling this must be something on the system itself.

By: Tilghman Lesher (tilghman) 2010-04-15 14:55:00

Don't forget res_odbc.conf.  This file is an important connector between func_odbc and the library, yet you have not included its contents.

By: Paul Belanger (pabelanger) 2010-05-03 09:43:53

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.

Further information can be found at http://www.asterisk.org/developers/bug-guidelines

By: David Sharon (davidsharon) 2010-05-05 04:08:08

in res_odbc.conf,

[test]
enabled => yes
dsn => test
username => asterisk
password => *****
pre-connect => no  

when I set pre-connect => yes and reload (at CLI), I have the following error:

[2010-05-05 18:02:35.404] NOTICE[10504]: res_odbc.c:838 odbc_obj_connect: Connecting test
asterisk: symbol lookup error: /opt/oracle/product/11.2.0/dbhome_1/odbc/libsqora.so.11.1: undefined symbol: SQLGetPrivateProfileStringW

When i check iSQL, it is working.

By: Tilghman Lesher (tilghman) 2010-05-07 11:29:10

Are you installing unixODBC from package or from source?

By: David Sharon (davidsharon) 2010-05-21 08:00:55

from package...

in res_odbc.conf,

[test]
enabled => yes
dsn => test
username => asterisk
password => ****
pre-connect => yes

when I restart Asterisk Server, I got the following error:

== Parsing '/etc/asterisk/asterisk.conf':   == Found
 == Parsing '/etc/asterisk/extconfig.conf':   == Found
 == Parsing '/etc/asterisk/logger.conf':   == Found
Asterisk Event Logger Started /var/log/asterisk/event_log
Asterisk Dynamic Loader Starting:
 == Parsing '/etc/asterisk/modules.conf':   == Found
[May 22 02:58:19] NOTICE[31358]: loader.c:1055 load_modules: 3 modules will be loaded.
 == Parsing '/etc/asterisk/res_odbc.conf':   == Found
[May 22 02:58:19] NOTICE[31358]: res_odbc.c:838 odbc_obj_connect: Connecting test
asterisk: symbol lookup error: /opt/oracle/product/11.2.0/dbhome_1/odbc/libsqora.so.11.1: undefined symbol: SQLGetPrivateProfileStringW  

So, the version of UnixODBC is 2.3.0



By: Paul Belanger (pabelanger) 2010-06-30 15:20:35

Could you please test with 1.6.2
--
Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.6.0 and 1.6.1 branches has ended. For continued maintenance support please move to the 1.6.2 branch.

More information on this change can be found in the release announcement: http://www.asterisk.org/node/49924

By: Paul Belanger (pabelanger) 2010-07-19 10:28:21

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.

Further information can be found at http://www.asterisk.org/developers/bug-guidelines