System information

Verifying binary data stored in PostgreSQL
To make sure the recording really did make it into the database, use the psql application:
$ psql -h localhost -U asterisk asterisk
Password:
then run a SELECT statement to verify that you have some data in the voicemessages table:
localhost=# SELECT uniqueid,dir,callerid,mailboxcontext,recording FROM voicemessages;
uniqueid | dir | callerid
---------+--------------------------------------------------+--------------
1 | /var/spool/asterisk/voicemail/default/1000/INBOX | +18005551212
| mailboxcontext | recording |
+----------------+-----------+
| default | 47395 |
(1 row)
If the recording was placed in the database, you should get a row back. You’ll notice
that the recording column contains a number (which will most certainly be different
from that listed here), which is really the object ID of the large object stored in a system
table. You can verify that the large object exists in this system table with the lo_list
command:
localhost=# \lo_list
Large objects
ID | Description
-------+-------------
47395 |
(1 row)
What you’re verifying is that the object ID in the voicemessages table matches that listed
in the large object system table. You can also pull the data out of the database and store
it to the hard drive:
localhost=# \lo_export 47395 /tmp/voicemail-47395.wav
lo_export
Then verify the audio with your favorite audio application, such as play:
$ play /tmp/voicemail-47395.wav
Input Filename : /tmp/voicemail-47395.wav
Sample Size : 8-bits
Sample Encoding: wav
Channels : 1
Sample Rate : 8000
Time: 00:06.22 [00:00.00] of 00:00.00 ( 0.0%) Output Buffer: 298.36K
Done.
ODBC Voicemail | 385