Disable odbc voicemail storage?

Hi Folks,

I’m running Asterisk 11 with a2billing.
I have a problem with odbc voicemail storage. As I test I want to disable it. The problem is temp greetings can’t be recorded. This is a trace as a temp greeting is recorded.

root@Asterisk-A2B-May2018:/var/spool/asterisk/voicemail/default/1045001/tmp# asterisk -vvvvvr | grep “WARNING|Playing”
– <SIP/22246-00088cfb> Playing ‘vm-password.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-youhave.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-no.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-messages.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-opts.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-options.slin’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-rec-temp.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘beep.alaw’ (language ‘en’)  Recorded temp greeting
– <SIP/22246-00088cfb> Playing ‘auth-thankyou.ulaw’ (language ‘en’)  Pressed ~#
– <SIP/22246-00088cfb> Playing ‘vm-review.ulaw’ (language ‘en’)
– <SIP/22246-00088cfb> Playing ‘vm-msgsaved.ulaw’ (language ‘en’)  Pressed 1.
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: app_voicemail.c:4160 insert_data_cb: SQL Direct Execute failed!
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: app_voicemail.c:4160 insert_data_cb: SQL Direct Execute failed!
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: res_odbc.c:604 ast_odbc_direct_execute: SQL Execute error! Verifying connection to MySQL-a2billing14 [MySQL-a2billing14]…
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: res_odbc.c:604 ast_odbc_direct_execute: SQL Execute error! Verifying connection to MySQL-a2billing14 [MySQL-a2billing14]…
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: app_voicemail.c:4160 insert_data_cb: SQL Direct Execute failed!
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: app_voicemail.c:4160 insert_data_cb: SQL Direct Execute failed!
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: app_voicemail.c:4276 store_file: SQL Execute error!
[2019-01-14 17:26:18] WARNING[29132][C-0004aa0c]: app_voicemail.c:4276 store_file: SQL Execute error!

I’m not an expert on odbc and would appreciate some tips. My voicemessages table definition looks as follows:

mysql> describe voicemessages;
±---------------±------------±-----±----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±---------------±------------±-----±----±--------±------+
| msg_id | varchar(40) | NO | PRI | | |
| msgnum | int(11) | NO | | 0 | |
| dir | varchar(80) | YES | MUL | | |
| context | varchar(80) | YES | | | |
| macrocontext | varchar(80) | YES | | | |
| callerid | varchar(40) | YES | | | |
| origtime | varchar(40) | YES | | | |
| duration | varchar(20) | YES | | | |
| mailboxuser | varchar(80) | YES | | | |
| mailboxcontext | varchar(80) | YES | | | |
| recording | longblob | YES | | NULL | |
| flag | varchar(8) | YES | | | |
| read | tinyint(1) | YES | | 0 | |
±---------------±------------±-----±----±--------±------+
13 rows in set (0.00 sec)

Thanks,
Q.

Also it’s trying to write nonsense to the table:

[INSERT INTO voicemessages (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]

You can’t disable it in the configuration, you have to rebuild it without ODBC support. Have you done so?

I think I’ve fixed this by changing the voicemailmessages table description. Working for my backup server, need to test in production.

mysql> describe voicemessages;
+----------------+-------------+------+-----+---------+-------+
| Field          | Type        | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+-------+
| msg_id         | varchar(40) | YES  |     | NULL    |       |
| msgnum         | varchar(40) | YES  |     | NULL    |       |
| dir            | varchar(80) | YES  | MUL |         |       |
| context        | varchar(80) | YES  |     | NULL    |       |
| macrocontext   | varchar(80) | YES  |     | NULL    |       |
| callerid       | varchar(40) | YES  |     | NULL    |       |
| origtime       | varchar(40) | YES  |     | NULL    |       |
| duration       | varchar(20) | YES  |     | NULL    |       |
| mailboxuser    | varchar(80) | YES  |     | NULL    |       |
| mailboxcontext | varchar(80) | YES  |     | NULL    |       |
| recording      | longblob    | YES  |     | NULL    |       |
| flag           | varchar(8)  | YES  |     | NULL    |       |
| read           | tinyint(1)  | YES  |     | 0       |       |
+----------------+-------------+------+-----+---------+-------+
13 rows in set (0.01 sec)

I can confirm that changing the voicemessages table definition fixed this. We had imported a database from an older version of Asterisk.
Hopefully this can help someone in the future.

Q.