I am using version 16,
The problem MySQL is loading before the asterisk, so the cel_odbc and cdr_odbc modules do not write data to the database.
Reloading these modules helps resolve the issue.
I’m thinking of running the asterisk through the script, but for this you need to turn it off.
systemctl’s not working sounds like an OS problem, not an Asterisk one. The two commands are mutually incompatible, because they relate to two different start-up systems. As such, I wouldn’t expect to find both on one system.
[2021-06-21 19:46:06] WARNING[906] codec_g729a.c: Failed to initialize G.729 copy protection!
[2021-06-21 19:46:06] NOTICE[976] chan_sip.c: Peer ‘SIP_SERVER_LOCAL’ is now Reachable. (1ms / 2000ms)
[2021-06-21 19:46:06] ERROR[906] cdr_mysql.c: Failed to connect to mysql database asterisk on 127.0.0.1.
[2021-06-21 19:46:06] WARNING[906] loader.c: Module ‘cdr_mysql’ has been loaded but may be removed in a future release. Its replacement is ‘cdr_adaptive_odbc’.