I use Asterisk 16.5.0, Mysql 5.7.28 and MySQL ODBC 8.0 Unicode Driver. I configured connection with MySql via ODBC connection. After some time Asterisk shows warning like that.
I resolved problem with increase interactive_timeout and wait_timeout. One day enough for me (1 day = 86400 secnd)
interactive_timeout=86400
wait_timeout=86400
I still cannot understand that why command odbc show returns
Number of active connections: 1 (out of 1)
but connection is broken. It looks from database (nothing inserts to tables like cdr, cel, queue_log) and also i looked connected users from mysql with command show processlist. Really which user Asterisk connects to Mysql not exist in connectected users. What does show command odbc show ? Or may be exist some bug in odbc show ?
It shows the ODBC configuration as defined for Asterisk and the connections that are active. The above means that there is a single ODBC connection to the database active, from the perspective of Asterisk and ODBC.
ODBC is an abstraction layer so stuff can happen underneath in the ODBC part of the MySQL connector part, of which Asterisk is unaware.
I happens again with connection problem.
How can i increase timeout time between Asterisk and Mysql (via ODBC connection).
I know some metod which solve this problem.
Every 1 hour execute command with cron job.
asterisk -rx 'reload'
With this command Asterisk reload resumes connection or restore died connection.
But I think that is not a professional approach.