Storing Voicemail in PostgreSQL via ODBC

Hi,
I have asterisk Asterisk 16.4.0 and I configured voicemail storing ODBC. I used this document https://wiki.asterisk.org/wiki/display/AST/Storing+Voicemail+in+PostgreSQL+via+ODBC.
I already have cdr and config working on ODBC but I could not make voicemail work.

It does not show any error on the console during recording the message.

/etc/odbcinst.ini

[PostgreSQL ANSI]
Description=PostgreSQL ODBC driver (ANSI version)
Driver=psqlodbca.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1

[PostgreSQL Unicode]
Description=PostgreSQL ODBC driver (Unicode version)
Driver=psqlodbcw.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1

/etc/odbc.ini

[anequim_config]
Description         = PostgreSQL Unicode connection to 'anequim_config' database
Driver              = PostgreSQL Unicode
Database            = anequim_config
Servername          = localhost
UserName            = asterisk
Password            = asterisk
Port                = 5432
Protocol            = 9.6
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

[anequim_cdr]
Description         = PostgreSQL Unicode connection to 'anequim_cdr' database
Driver              = PostgreSQL Unicode
Database            = anequim_cdr
Servername          = localhost
UserName            = asterisk
Password            = asterisk
Port                = 5432
Protocol            = 9.6
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

[anequim_voicemail]
Description         = PostgreSQL Unicode connection to 'anequim_voicemail' database
Driver              = PostgreSQL Unicode
Trace               = No
TraceFile           = anequim_voicemail.log
Database            = anequim_voicemail
Servername          = localhost
UserName            = asterisk
Password            = asterisk
Port                = 5432
Protocol            = 9.6
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

res_odbc.conf

[anequim_config]
enabled => yes
dsn => anequim_config
username => asterisk
password => asterisk
pre-connect => yes

[anequim_cdr]
enabled => yes
dsn => anequim_cdr
username => asterisk
password => asterisk
pre-connect => yes
logging => yes

[anequim_voicemail]
enabled => yes
dsn => anequim_voicemail
username => asterisk
password => asterisk
pre-connect => yes
logging => yes
Connected to Asterisk 16.4.0 currently running on finti (pid = 25333)
finti*CLI> odbc show

ODBC DSN Settings
-----------------

  Name:   anequim_config
  DSN:    anequim_config
    Number of active connections: 1 (out of 1)
    Logging: Disabled

  Name:   anequim_cdr
  DSN:    anequim_cdr
    Number of active connections: 1 (out of 1)
    Logging: Enabled
    Number of prepares executed: 1
    Number of queries executed: 1
    Longest running SQL query: INSERT INTO queue_log (time, data5, data4, data3, data2, data1, event, agent, queuename, callid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (2 milliseconds)

  Name:   anequim_voicemail
  DSN:    anequim_voicemail
    Number of active connections: 1 (out of 1)
    Logging: Enabled
    Number of prepares executed: 0
    Number of queries executed: 0

Check the voicemessages table via the isql utility:

voicemail.conf

[general]
format=wav
odbcstorage=anequim_voicemail
odbctable=voicemessages

Voicemail working:

I did everything as described but it isn’t working, did I miss something? Can someone help me?

Which voicemail module do you have loaded? What’s the output of “module show like app_voicemail” from the Asterisk CLI?

Hi, here is the output:

You’ll need to unload the app_voicemail.so module and load the app_voicemail_odbc.so module instead. In modules.conf, you can always add “noload=>app_voicemail.so” and “load=>app_voicemail_odbc.so”.

How can I make app_voicemail_odbc.so available? I find on make menuselect the option of
Voicemail Build Options > ODBC_STORAGE.
I select this option and then ran make install.
vm-odbc
But it didn’t make app_voicemail_odbc.so available.

I ran make menuselect this time I looked on Applications, but it still showing only app_voicemail.
vm-vm

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.