Asterisk 12 odbc voicemail problem

I’m running Asterisk 12.4
I have decided to use odbc but can’t get voicemail to work.
I’m getting these errors:
[Jul 29 15:27:18] == Parsing ‘/var/spool/asterisk/voicemail/default/1004/INBOX/msg0000.txt’: Found
[Jul 29 15:27:18] WARNING[30001][C-00000000]: app_voicemail.c:4167 insert_data_cb: SQL Direct Execute failed!
[Jul 29 15:27:18] WARNING[30001][C-00000000]: res_odbc.c:618 ast_odbc_direct_execute: SQL Execute error! Verifying connection to asterisk [asterisk-connector]…
[Jul 29 15:27:18] WARNING[30001][C-00000000]: app_voicemail.c:4167 insert_data_cb: SQL Direct Execute failed!
[Jul 29 15:27:18] WARNING[30001][C-00000000]: app_voicemail.c:4283 store_file: SQL Execute error!
[INSERT INTO voicemessages (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]
I have used func_odbc to confirm that I can read and write from/to the database.
The query looks strange. I don’t understand why there are all the ?
I have added an entry to func_odbc which enables me to write a query and I’ve tried the above and it tells me I have an error in my sql syntax which isn’t a surprise.

When I reloaded app_voicemail.so I got:
module load app_voicemail.so
Loaded app_voicemail.so
[Jul 29 15:23:42] > Registering module app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_destroy: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_destroy: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_unset: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_set: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_interface_find: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_putback: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_wait_station: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_wait: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_pop: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_putback: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_wait: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_pop: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_interface_unref: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_interface_unref: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_pop: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_wait: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_putback: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_pop: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_wait: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_wait_station: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_putback: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_interface_find: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_set: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_unset: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_destroy: stubbing for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_destroy: stubbing for app_voicemail
[Jul 29 15:23:42] > Unregistering module app_voicemail
[Jul 29 15:23:42] > Registering module app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_destroy: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_destroy: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_unset: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_set: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_interface_find: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_putback: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_wait_station: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_wait: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_mwi_message_pop: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_putback: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_wait: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_md_message_pop: linking for app_voicemail
[Jul 29 15:23:42] > ast_smdi_interface_unref: linking for app_voicemail
[Jul 29 15:23:42] == Parsing ‘/etc/asterisk/voicemail.conf’: Found
[Jul 29 15:23:42] == Parsing ‘/etc/asterisk/users.conf’: Found
[Jul 29 15:23:42] – No voicemail provider registered.
[Jul 29 15:23:42] == Registered application ‘VoiceMail’
[Jul 29 15:23:42] == Registered application ‘VoiceMailMain’
[Jul 29 15:23:42] == Registered application ‘MailboxExists’
[Jul 29 15:23:42] == Registered application ‘VMAuthenticate’
[Jul 29 15:23:42] == Registered application ‘VoiceMailPlayMsg’
[Jul 29 15:23:42] == Registered application ‘VMSayName’
[Jul 29 15:23:42] == Registered custom function ‘MAILBOX_EXISTS’
[Jul 29 15:23:42] == Registered custom function ‘VM_INFO’
[Jul 29 15:23:42] == Manager registered action VoicemailUsersList
[Jul 29 15:23:42] == Manager registered action VoicemailRefresh
[Jul 29 15:23:42] > Found uniqueid column with type 4 with len 10, octetlen 10, and numlen (0,10)
[Jul 29 15:23:42] > Found context column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found mailbox column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found password column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found fullname column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found alias column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found email column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found pager column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found attach column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found attachfmt column with type 12 with len 10, octetlen 10, and numlen (0,0)
[Jul 29 15:23:42] > Found serveremail column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found language column with type 12 with len 20, octetlen 20, and numlen (0,0)
[Jul 29 15:23:42] > Found tz column with type 12 with len 30, octetlen 30, and numlen (0,0)
[Jul 29 15:23:42] > Found deletevoicemail column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found saycid column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found sendvoicemail column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found review column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found tempgreetwarn column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found operator column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found envelope column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found sayduration column with type 4 with len 10, octetlen 10, and numlen (0,10)
[Jul 29 15:23:42] > Found forcename column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found forcegreetings column with type 1 with len 3, octetlen 3, and numlen (0,0)
[Jul 29 15:23:42] > Found callback column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found dialout column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found exitcontext column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found maxmsg column with type 4 with len 10, octetlen 10, and numlen (0,10)
[Jul 29 15:23:42] > Found volgain column with type 3 with len 5, octetlen 5, and numlen (2,10)
[Jul 29 15:23:42] > Found imapuser column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found imappassword column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found imapserver column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found imapport column with type 12 with len 8, octetlen 8, and numlen (0,0)
[Jul 29 15:23:42] > Found imapflags column with type 12 with len 80, octetlen 80, and numlen (0,0)
[Jul 29 15:23:42] > Found stamp column with type 93 with len 19, octetlen 19, and numlen (0,10)
[Jul 29 15:23:42] Loaded app_voicemail.so => (Comedian Mail (Voicemail System) with ODBC Storage)

This looks OK to me. At least there aren’t any error msgs!

Any suggestions?

Although I hate to admit it the answer was there but to excuse myself I’d say the error msgs are cryptic.

https://wiki.asterisk.org/wiki/display/AST/ODBC+Voicemail+Storage I corrected the table definition and it works!