I am using Asterisk in conjunction with OpenSIPS. I set up Asterisk with an ODBC connection to a MySQL database for sipusers. The issue I am seeing is that the ODBC connection keeps going down without Asterisk knowing it went down. It appears to go down every 15 seconds. This is causing issues with calls because I timeout an Asterisk server on OpenSIPS if it doesn’t respond quickly enough. And Asterisk doesn’t respond quickly enough because it has to notice that the odbc connection is down and then reconnect. Here is what I have in my res_odbc.conf
[MySQL-01]
enabled => yes
dsn => asterisk-connector
username => #####
password => #####
pooling => no
limit => 1
pre-connect => yes
sanitysql => select 1
idlecheck => 1
And here you can see the issue in action
Asterisk18*CLI> odbc show
ODBC DSN Settings
Name: proxy01
DSN: MySQL-proxy01
Last connection attempt: 1969-12-31 18:00:00
Pooled: No
Connected: Yes
[Mar 1 16:29:21] WARNING[13649]: res_odbc.c:744 ast_odbc_sanity_check: Connection is down attempting to reconnect…
[Mar 1 16:29:26] NOTICE[13649]: res_odbc.c:1480 odbc_obj_connect: Connecting proxy01
[Mar 1 16:29:26] NOTICE[13649]: res_odbc.c:1510 odbc_obj_connect: res_odbc: Connected to proxy01 [MySQL-proxy01]
Asterisk18CLI>
Asterisk18CLI> odbc show
ODBC DSN Settings
Name: proxy01
DSN: MySQL-proxy01
Last connection attempt: 1969-12-31 18:00:00
Pooled: No
Connected: Yes
Asterisk18*CLI> odbc show
ODBC DSN Settings
Name: proxy01
DSN: MySQL-proxy01
Last connection attempt: 1969-12-31 18:00:00
Pooled: No
Connected: Yes
[Mar 1 16:30:01] WARNING[13649]: res_odbc.c:744 ast_odbc_sanity_check: Connection is down attempting to reconnect…
[Mar 1 16:30:06] NOTICE[13649]: res_odbc.c:1480 odbc_obj_connect: Connecting proxy01
[Mar 1 16:30:06] NOTICE[13649]: res_odbc.c:1510 odbc_obj_connect: res_odbc: Connected to proxy01 [MySQL-proxy01]
How can I fix this issue??