[asterisk-bugs] [JIRA] (ASTERISK-24441) Unable to store voicemail greetings using PostgreSQL with ODBC

Anthony Messina (JIRA) noreply at issues.asterisk.org
Tue Oct 28 18:08:31 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-24441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=223175#comment-223175 ] 

Anthony Messina commented on ASTERISK-24441:
--------------------------------------------

Yes, it does work properly if I change the columns to character varying.  I guess there are two ways things could go:
1. Use integer columns (as the data truly are integers) and correct app_voicemail to insert the data as integers rather than strings (probably more "correct")
2. Fix the table creation alembic scripts and documentation indicating that the tables be created with integer columns (probably "easier")

The only issue I see with 2 is that there isn't a way to upgrade the table to convert from integer to varchar.  The data would need to be manually dumped, corrected for reinsertion (properly quoted) as string values, and reinserted into the table with varchar columns.

> Unable to store voicemail greetings using PostgreSQL with ODBC
> --------------------------------------------------------------
>
>                 Key: ASTERISK-24441
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24441
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_voicemail/ODBC
>    Affects Versions: 13.0.0-beta2
>         Environment: Fedora 20 x86_64, PostgreSQL 9.3.5
>            Reporter: Anthony Messina
>            Assignee: Anthony Messina
>
> Using ODBC voicemail with PostgreSQL backend, I am unable to store voicemail greetings as Asterisk (app_voicemail) attempts to insert invalid integers into the recommended PostgreSQL table, yielding the PostgreSQL error
> {code}
> invalid input syntax for integer: ""
> {code}
> The issue appears to be that Asterisk is passing NULL values as "" and is quoting integers, like "-1" via the store_file function in app_voicemail.c
> I get errors similar to what the user described at http://stackoverflow.com/questions/22863602/unable-to-store-voicemail-through-odbc-in-asterisk
> {code}
> [Oct 19 13:32:04] DEBUG[28796][C-00000000]: res_odbc.c:1062 odbc_release_obj2: odbc_release_obj2(0x252f738) called (obj->txf = (nil))
> [Oct 19 13:32:04] WARNING[28796][C-00000000]: app_voicemail.c:4186 insert_data_cb: SQL Direct Execute failed!
> [Oct 19 13:32:04] WARNING[28796][C-00000000]: res_odbc.c:617 ast_odbc_direct_execute: SQL Execute error! Verifying connection to asterisk [asterisk]...
> [Oct 19 13:32:04] WARNING[28796][C-00000000]: app_voicemail.c:4186 insert_data_cb: SQL Direct Execute failed!
> [Oct 19 13:32:04] WARNING[28796][C-00000000]: app_voicemail.c:4302 store_file: SQL Execute error!
> [INSERT INTO voicemail_messages (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list