asterisk -vr prints SQL WARNINGS insert failed Data too long

asterisk -vr prints SQL WARNINGS insert failed Data too long

Symptom


asterisk -vr


Prints like:

[2026-02-11 15:13:49] WARNING[29897]: res_odbc.c:529 ast_odbc_print_errors: SQL Execute returned an error: 22001: [ma-3.1.12][10.3.39-MariaDB]Data too long for column 'lastdata' at row 1[2026-02-11 15:13:49] WARNING[29897]: res_odbc.c:424 ast_odbc_prepare_and_execute: SQL Execute error -1![2026-02-11 15:13:49] WARNING[29897]: cdr_adaptive_odbc.c:766 odbc_log: cdr_adaptive_odbc: Insert failed on 'scopserv:cdr_pre'. CDR failed: INSERT INTO cdr_pre (calldate, clid, src, dst, dcontext, channel, dstchannel,lastapp,lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, hangupcause, recvip, fromchan, uri, useragent, codec1, codec2, llp, rlp,


Fix

Execute:

mysql scopserv -e 'alter table cel modify column appdata varchar(1024)'

Warning

Adding the column length can lock tables the tables for some time. Only execute during idle periods.






    • Related Articles

    • Module 21 - ScopTEL IP PBX Software - Asterisk T.38 Fax Gateway Configuration

      ScopTEL Asterisk T.38 Fax Gateway Full T.38 Capabilities Initial support for handling of T.38 sessions was merged into the Asterisk 1.4 codebase. Inside of Asterisk 1.4, it is possible to perform what is referred to as T.38 passthrough. T.38 ...
    • Database recovery commands

      Check and repair mysql db mysqlcheck -A -r Asterisk prints mysql.column errors [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255). Cause: MySQL ...
    • Asterisk 18 is Officially Deprecated. Update to Asterisk 20 Recommended

      Background Sangoma manages a release cycle with Asterisk versions and Asterisk 18 is in Security Fix Only mode. See: https://docs.asterisk.org/About-the-Project/Asterisk-Versions/ Asterisk 20 LTS (EOL 2027-10-19) is its obvious replacement since ...
    • Product Bulletin- End Of Life Announcement for Asterisk 13

      As of September 21, 2021 ScopServ is officially deprecating all versions of Asterisk 13 and marking all support for Asterisk 13.x End Of Life. Beginning with scopserv-telephony25-7.4.3.3.20210914-2 Asterisk 18.x will be the default version of ...
    • Module 18 - ScopTEL IP PBX Software - Troubleshooting

      General Troubleshooting Most telephony errors are caused by one of the following causes: Bad authentication credentials DNS resolution Class of Service misconfigurations Firewall issues Asterisk bugs User error (DND, call forwarding etc.) CLI tools ...