Asterisk freezing when losing ODBC connection

I’ve been experiencing this for almost two years without ever understanding what is really going on or how to fix it. I’m running an Asterisk box that does some regular ODBC queries to an Informix database. The caller inputs an associate ID and Asterisk get his name and other info via this query.

When all is working well, everything is perfect. Not a single problem.

When the database goes down, Asterisk just can’t keep going. It freezes. All numbers are busy. You type commands in the console but they don’t seem to respond. The fix is always to disable the DSN in the res_odbc.conf file and then issue a “service asterisk restart”. The section is as follows:

enabled => yes (this is where I disable it by putting “no” and restarting Asterisk)
pre-connect => yes
connect_timeout => 2
dsn => spmcli
username => (username)
password => (password)
sanitysql => select count(*) from systables;
negative_connection_cache => 300

Even the debugging stops when the freeze happens, without any meaningful message explaining what happened.

Anyone knows what can I do to make Asterisk just keep going if the database goes down instead of stopping all operations?

Many thanks. … +Backtrace

You may have a deadlock or you may have an outright crash. If you run something like safe_sterisk, it should restart after an outright crash.


You may have a deadlock or you mahy hva an outright crash. If you run something like Asterisk, it should restart after an outright crash.[/quote]

Thanks. Sorry for the late reply, I’ve been sick. I will look into it. Asterisk never restarts when this happens, you can still get into the console, but all activity is null. So according to your words we should be talking about a deadlock.

That does sound like a deadlock.

(Sorry for the excessive number of typos, last time.)

[quote=“david55”]That does sound like a deadlock.

(Sorry for the excessive number of typos, last time.)[/quote]

The company bought a new quad E1 Digium card so I’m going to install an entirely new Asterisk box (11.x.x). Since this time I’m not restrained anymore from upgrading it (the current server’s E1 card is old and the driver barely works on 1.8.x after modifying its source code), I’m betting the newer setup will work better. If I still get deadlocks, well, I’ll have to keep digging :open_mouth:

Sadly I must report I still get the same freezing. It happened once until now but overall all the symptoms were the same, only this time I’m running Asterisk 11.4.0, DAHDI 2.7.0 and the interface is a shiny TE410P (4th generation). The Informix client is 3.50 UC9.

The current released version is 11.6.0.

Otherwise, you are going to have to enable the debugging features that I mentioned.