Storage Voicemail in PostgreSQL Whit ODBC


#1

Hello,

I have asterisk 13.13 and I configured voicemail storing ODBC. I used this document https://wiki.asterisk.org/wiki/display/AST/Storing+Voicemail+in+PostgreSQL+via+ODBC

When I tryied to leav voicemail. I take below error. Do you have any idea?

  -- Executing [5@custom-uluslararasi:1] VoiceMail("PJSIP/5644-00000002", "4073@default") in new stack
       > 0x7f43a8028eb0 -- Probation passed - setting RTP source address to 136.10.195.20:4034
[Jun 11 10:36:36] WARNING[6409][C-00000002]: res_odbc.c:460 ast_odbc_print_errors: SQL Execute returned an error: HY000: ERROR:  operator does not exist: integer = character at character 97;
Error while executing the query
[Jun 11 10:36:36] WARNING[6409][C-00000002]: res_odbc.c:404 ast_odbc_prepare_and_execute: SQL Execute error -1!
[Jun 11 10:36:36] WARNING[6409][C-00000002]: app_voicemail.c:3887 retrieve_file: SQL Execute error!
[SELECT * FROM voicemessages WHERE dir=? AND msgnum=?]

    -- <PJSIP/5644-00000002> Playing 'vm-intro.g722' (language 'tr')
    -- <PJSIP/5644-00000002> Playing 'beep.g722' (language 'tr')
    -- Recording the message
    -- x=0, open writing:  /var/spool/asterisk/voicemail/default/4073/tmp/FuoT3Z format: wav, 0x7f433c002090
    -- User hung up
[Jun 11 10:36:54] WARNING[6409][C-00000002]: res_odbc.c:460 ast_odbc_print_errors: SQL Execute returned an error: HY000: ERROR:  operator does not exist: integer = character at character 95;
Error while executing the query
[Jun 11 10:36:54] WARNING[6409][C-00000002]: res_odbc.c:404 ast_odbc_prepare_and_execute: SQL Execute error -1!
[Jun 11 10:36:54] WARNING[6409][C-00000002]: app_voicemail.c:4193 delete_file: SQL Execute error!
[DELETE FROM voicemessages WHERE dir=? AND msgnum=?]

  == Parsing '/var/spool/asterisk/voicemail/default/4073/INBOX/msg0000.txt': Found
[Jun 11 10:36:54] WARNING[6409][C-00000002]: app_voicemail.c:4291 insert_data_cb: SQL Direct Execute failed!
[Jun 11 10:36:54] WARNING[6409][C-00000002]: app_voicemail.c:4407 store_file: SQL Execute error!
[INSERT INTO voicemessages (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]

Thank you.


#2

I would guess this could be a schema problem where you possibly have a varchar instead of a integer.

DId you use the schema provided in the contrib directory of the asterisk source to create your database table?