Hello,
We are using Asterisk 18.12.1-1. We are having an issue that when there is “congestion” to MySQL, Asterisk does not process any new calls until the congestion clears.
For example, if we create 2k channels (1k calls) and then do a channel request hangup all
, it will still take a while [after the channels are destroyed] for Asterisk to accept new calls. We can see that Asterisk is still trying to write to the CDR DB.
I am not sure if this is a bug specific to this version of Asterisk or there is anything else here.
FWIW, I started looking at the ODBC connection and I see that Asterisk will only uses 1 connection --no matter how many calls there are on the system.
[root@chart ~]# cat /etc/odbc.ini
[MySQL-asterisk]
Description = Asterisk CDR
Driver = MariaDB
Database = asterisk
User = asterisk
Password = asterisk
Server = localhost
Socket = /var/lib/mysql/mysql.sock
[MySQL-chartpbx]
Description = Asterisk CDR
Driver = MariaDB
Database = chartdata
User = <user>
Password = <pass>
Server = localhost
Socket = /var/lib/mysql/mysql.sock
[root@chart ~]# cat /etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => MySQL-asterisk
max_connections => 5
username => asterisk
password => asterisk
pre-connect => yes
[chartpbx]
enabled => yes
dsn => MySQL-chartpbx
max_connections => 5
username => vitalpbx
password => vitalpbx
pre-connect => yes
[root@chart ~]# cat /etc/asterisk/cdr_adaptive_odbc.conf
[asterisk]
connection=asterisk
loguniqueid=yes
table=cdr
usegmtime=yes
alias start => calldate
[root@chart ~]# asterisk -x"odbc show all"
ODBC DSN Settings
-----------------
Name: asterisk
DSN: MySQL-asterisk
Number of active connections: 1 (out of 5)
Logging: Disabled
Name: chartpbx
DSN: MySQL-chartpbx
Number of active connections: 1 (out of 5)
Logging: Disabled
[root@chart ~]# asterisk -x"cdr show status"
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log calls by default: Yes
Log unanswered calls: Yes
Log congestion: Yes
* Registered Backends
-------------------
Adaptive ODBC
csv
cdr-custom
I reloaded Asterisk and rebooted the server, it still seems to only keep one active connection open at all times.
On another system running Asterisk 18.15.1, I do see that the connections increase occasionally, but I can’t spot really any differences in the configuration:
Name: asterisk
DSN: MySQL-asterisk
Number of active connections: 2 (out of 5)
Logging: Disabled
What am I missing?
Thanks