My asterisk restart from time to time the last error is a res_odbc error

Hi I have a Asterisk 11.12.1

From time to time my Asterisk restart I think its a database issue because on the log the last error is a database error:

[Jul 13 22:27:03] WARNING[2302] res_odbc.c: SetConnectAttr (Autocommit) returned an error: HY000: [FreeTDS][SQL Server]Could not change transaction status
[Jul 13 22:27:03] WARNING[2302] res_odbc.c: SetConnectAttr (Autocommit) returned an error: HY000: [FreeTDS][SQL Server]Could not change transaction status
[Jul 13 22:27:03] WARNING[2302] res_odbc.c: SetConnectAttr (Autocommit) returned an error: HY000: [FreeTDS][SQL Server]Could not change transaction status
[Jul 13 22:27:03] WARNING[2302] res_odbc.c: SQL Execute returned an error -1: 24000: [FreeTDS][SQL Server]Invalid cursor state (41)
[Jul 13 22:27:03] WARNING[2302] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [asterisk]...
[Jul 13 22:27:03] WARNING[2302] res_odbc.c: Connection is down attempting to reconnect...
[Jul 13 22:27:08] Asterisk 11.12.1 built by root @ GM-PBX-C6-01 on a x86_64 running Linux on 2020-12-02 18:01:18 UTC

The thing is that this is working all day but from time to time it returns this to me and restart.

I have this on my res_odbc.conf file.

[asterisk]
enabled=>yes
username=>user
password=>XXXX
pooling=>no
pre-connect=>yes
dsn=>asterisk

I haven’t found what its happening, do any of you checked over this?

11.12.1 hasn’t been supported for just short of seven years, and no sub-version of Asterisk 11 has been supported for just short of five years!

Please try to reproduce the problem on a current version, and if you are able to reproduce it, please obtain a backtrace from an unoptimised build, see:

https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

However, I think it is likely that the problem, or at least the primary failure, is in FreeTDS, or the database, not Asterisk.

Thanks I will review it. And try to change to a new version. The problem is that I need a r2 protocol that doesn’t work with new versions.