[HELP] res_odbc dsn failover hangs

Hi All,

I am trying to setup dsn failover for res_odbc and it is not working. I have a dial plan that looks up data in a mssql database and routes the call accordingly. I want to have failover so that if my primary db is down, the backup one will be used. I have confirmed both connections work from my server by using isql and tsql. During my tests I have both connections up, make a call, the first one is used and the dial plan works. I drop the connection from the first one (unplug the network cable) and the dial plan hangs until I hangup the call. After the call is hung up I start seeing this in the CLI:

WARNING[3534]: chan_sip.c:4403 __sip_autodestruct: Autodestruct on dialog ‘5b737d0f-374638eb@192.168.11.62’ with owner SIP/800-00000004 in place (Method: BYE). Rescheduling destruction for 10000 ms

Once this happens the whole system stops working and I have to stop and restart the asterisk service to get it working again. Any direction to start looking in would be great.

Thanks,

Frank

here is my setup:

----func_odbc.conf----
[GETROUTE]
prefix=IVR
dsn=asteriskprod01,asteriskprod02
readsql=Select NewCallerIdName, RouteToExt From IVRRoute where IncommingCallerIdNum = ‘${ARG1}’

----res_odbc_custom.conf----
[asteriskprod01]
enabled => yes
dsn => asterisk-connector01
pre-connect => yes
username => ****
password => ****
share_connections => no
backslash_is_escape => no
negative_connection_cache => 300
limit => 1
pooling => no

[asteriskprod02]
enabled => yes
dsn => asterisk-connector02
pre-connect => yes
username => ****
password => ****
share_connections => no
backslash_is_escape => no
negative_connection_cache => 300
pooling => no
limit => 1

-----odbc.ini------
[asterisk-connector01]
Description=Connect to Prod SQL
Driver=ms-sql
ServerName=ms-sql01

[asterisk-connector02]
Description=Connect to Prod SQL Backup
Driver=ms-sql
ServerName=ms-sql02

-----freetds.conf-----
[ms-sql01]
host = prodsql01
port = 1433
tds version = 8.0

[ms-sql02]
host = prodsql02
port = 1433
tds version = 8.0