Summary:ASTERISK-08956: app_directory does not seem to use recorded greetings if using odbc voicemail storage
Reporter:Edwin horton (edhorton)Labels:
Date Opened:2007-03-07 08:01:26.000-0600Date Closed:2007-07-09 21:20:42
Versions:Frequency of
Environment:Attachments:( 0) 20070509__bug9224.diff.txt
Description:Even though a greeting is recorded for a mailbox and verified to be in the database, app_directory spells the name rather than playing the recorded greeting when using ODBC voicemail storage.  This was found and fixed in 1.2 as reported in bug 0007349.  I was wondering is this patch did not make it in the 1.4 release.
Comments:By: Serge Vecher (serge-v) 2007-03-07 08:40:17.000-0600

next time, please reopen the bug, especially since you are the original poster --> so it's easy for you to do so.

By: Serge Vecher (serge-v) 2007-03-07 08:47:15.000-0600

the patch was applied to trunk r. 36380; in September, the 1.4 branch has been forked, so the patch did make it in. Is there any debug information that you can provide to help track this down?

By: Edwin horton (edhorton) 2007-03-08 18:01:20.000-0600

Sorry, I should have re-opened the original.  Anyway, I do not have any useful debug info yet.  The MySQL query log shows a query to get voicemail.conf data, but nothing else (my voicemail.conf is a MySQL realtime static table also accessed via ODBC as defined in my extconfig.conf).  There are various queries for mailbox msg count. Before I dig deaper tonight, I wanted to ask if there are restrictions on the database name and sound format? I have defined the database name in voicemail.conf as "asteriskodbc".  The only allowed sound format is wav49.  There seems to be static definations in app_directory for "asterisk" and "wav".  The voicemail app works well with my voicemail.conf definations, but I am not sure about app_directory.

By: Serge Vecher (serge-v) 2007-03-09 08:27:50.000-0600

Let's see if this console log provides any info
1) Prepare test environment (reduce the amount of unrelated traffic on the server);
2) Make sure your logger.conf has the following line:
  console => notice,warning,error,debug
3) restart Asterisk with the following command:
  'asterisk -Tvvvvvdddddngc | tee /tmp/verbosedebug.txt'
4) Enable verbose logging with the following CLI commands (1.4/trunk commands in parenthesis):
set debug 4 (core set debug 4)
set verbose 4 (core set verbose 4)
5) Reproduce the problem
6) Trim startup information and attach verbosedebug.txt to the issue.

By: Edwin horton (edhorton) 2007-03-09 08:50:02.000-0600

It seems that me debug was unsuccessful because the module was not compiled to use ODBC.  I notice that the compile variable for this option in app_voicemail.c is ODBC_STORAGE and in app_directory.c is USE_ODBC_STORAGE.  As a quick test, I set USE_ODBC_STORAGE true but now get compile errors due to the change in res_odbc.h.  The following errors were generated:
app_directory.c: In function `retrieve_file':
app_directory.c:107: error: `odbc_obj' undeclared (first use in this function)
app_directory.c:107: error: (Each undeclared identifier is reported only once
app_directory.c:107: error: for each function it appears in.)
app_directory.c:107: error: `obj' undeclared (first use in this function)
app_directory.c:108: warning: implicit declaration of function `fetch_odbc_obj'
app_directory.c:131: warning: implicit declaration of function `odbc_smart_execute'
app_directory.c: In function `play_mailbox_owner':
app_directory.c:282: error: `fn2' undeclared (first use in this function)
app_directory.c: In function `load_module':
app_directory.c:662: warning: assignment discards qualifiers from pointer target type
app_directory.c:665: warning: assignment discards qualifiers from pointer target type
app_directory.c:668: warning: assignment discards qualifiers from pointer target type
make[1]: *** [app_directory.o] Error 1

By: Russell Bryant (russell) 2007-03-27 18:22:46

After a few different commits to get things all fixed and up to date, this should be working now in both the 1.4 branch and trunk.

Revisions 59273 through 59278.


By: Leif Madsen (lmadsen) 2007-05-09 09:21:26

Sorry Russell, you can defer this from being assigned to you if you wish. I tested Directory() today again for the first time in a while, and I'm still having an issue playing audio files back out of the database (using PostgreSQL)

Debugs to follow.

By: Leif Madsen (lmadsen) 2007-05-09 09:23:26

Seems I'm still having issues playing a file back out of the database when the backend is PostgreSQL. Here is the errors I'm getting when Asterisk attempts to pull the information out of a PostgreSQL database:

[May  9 10:10:25] WARNING[25516]: app_directory.c:169 retrieve_file: SQL Get Data error!
[SELECT recording FROM voicemessages WHERE dir=? AND msgnum=-1]

[May  9 10:10:25] WARNING[25516]: res_odbc.c:201 ast_odbc_sanity_check: Connection is down attempting to reconnect...
[May  9 10:10:25] WARNING[25516]: res_odbc.c:460 odbc_obj_disconnect: res_odbc: disconnected 0 from asterisk [PostgreSQL-asterisk]
[May  9 10:10:25] NOTICE[25516]: res_odbc.c:502 odbc_obj_connect: Connecting asterisk
[May  9 10:10:26] NOTICE[25516]: res_odbc.c:516 odbc_obj_connect: res_odbc: Connected to asterisk [PostgreSQL-asterisk]
[May  9 10:10:26] DEBUG[25516]: channel.c:2911 set_format: Set channel SIP/ss1tampa-09bdd210 to write format slin
[May  9 10:10:26] WARNING[25516]: format_wav.c:112 check_header: Does not begin with RIFF
[May  9 10:10:26] WARNING[25516]: file.c:311 fn_wrapper: Unable to open format wav
[May  9 10:10:26] WARNING[25516]: file.c:809 ast_streamfile: Unable to open /var/spool/asterisk/voicemail/lmentinc/100/greet (format 0x4 (ulaw)): No such file or directory

Seems like an issue with the prepared statement maybe?

By: Tilghman Lesher (tilghman) 2007-05-09 09:38:01

blitzrage:  nope, same pgsql issue as we had in voicemail.  Patch replicated to app_directory, please test.

By: Leif Madsen (lmadsen) 2007-05-09 09:43:47

Tested and confirmed to work!

By: Tilghman Lesher (tilghman) 2007-05-09 09:51:27

Fixed in 63565, merged in 63566, 63567.