Hello,
I installed Asterisk 20.9.1 (Debian 12) and voicemail to MariaDB stopped working:
[Aug 6 11:04:10] WARNING[190137][C-0000000a]: app_voicemail_odbc.c:4753 odbc_insert_data_cb: SQL Execute error!
[INSERT INTO voicemessages (dir, msgnum, recording, context, macrocontext, callerid, origtime, duration, mailboxuser, mailboxcontext, flag, msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?)]
[Aug 6 11:04:10] WARNING[190137][C-0000000a]: res_odbc.c:529 ast_odbc_print_errors: SQL Execute returned an error: 21S01: [ma-3.1.16][10.11.6-MariaDB-0+deb12u1-log]Column count doesn't match value count at row 1
If you count the field names and ‘?’, there are indeed 12 field names and 11 values. I reverted to version 20.7.0, and now all works again. I could not find anything in the 20.9.1 release notes about this.
The issue was a result of the “macrocontext” field being removed in the master and 21 branches and a change being cherry-picking a change from the master and 21 branches to the 20 and 18 branches which still have the “macrocontext” field. The cherry-pick changed the number of ‘?’ placeholders to match master and 21 without regard to the fact that the “macrocontext” field was still there. @jdg’s fix should be in the next set of regular releases.