[Home]

Summary:ASTERISK-29026: app_voicemail: When a voicemail is marked as "Urgent", it is not sent by email/processed by the mailcmd command
Reporter:ben kolodny (benphone)Labels:voicemail
Date Opened:2020-08-12 10:19:01Date Closed:2020-08-20 13:20:32
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:16.11.1 Frequency of
Occurrence
Related
Issues:
duplicatesASTERISK-27273 app_voicemail: When a voicemail is marked as "Urgent", it is not sent by email/processed by the mailcmd command
Environment:Asterisk compiled from sources on CentOS 6.9 64 bit. Voicemail is stored on MySQL using ODBCAttachments:( 0) asterisk_log.txt
( 1) debug_log_27273.txt
( 2) voicemail.conf
( 3) voicemail.conf
( 4) voicemail.sql
Description:A mailbox is configured to allow review. Once the voicemail message is recorded, # is pressed to access the voicemail menu. Entry 4 is selected to mark the message as "Urgent" and then confirmed with 1. The message is not being sent by email nor processed by the mailcmd configuration parameter. The voicemail is however correctly stored in the ODBC database.

No weird messages are shown in the asterisk console, just the standard ones: (see asterisk_log.txt)

Comments:By: Asterisk Team (asteriskteam) 2020-08-12 10:19:02.572-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: ben kolodny (benphone) 2020-08-12 10:54:33.353-0500

the above described problem still exist

By: Kevin Harwell (kharwell) 2020-08-18 15:07:48.470-0500

If I'm reading the code correctly in the ODBC case {{notify_new_message}} (which eventually calls the configured "mailcmd") never gets called.

From the debug file:
{noformat}
[2017-09-21 13:03:41] DEBUG[11212][C-00000089] app_voicemail.c: Created an Urgent message, moving file from /var/spool/asterisk/voicemail/DEVEL/104/INBOX/msg0035 to /var/spool/asterisk/voicemail/DEVEL/104/Urgent/msg0007.
{noformat}
This is easily located in _app_voicemail.c_ in the {{leave_voicemail}} function:
{noformat}
...
ast_debug(5, "Created an Urgent message, moving file from %s to %s.\n", sfn, dfn);
RENAME(dir, msgnum, vmu->mailbox, vmu->context, urgdir, x, sfn, dfn);
/* Notification must happen for this new message in Urgent folder, not INBOX */
ast_copy_string(fn, dfn, sizeof(fn));
...
{noformat}
Soon after it checks to see if the file exists:
{noformat}
...
if (ast_fileexists(fn, NULL, NULL)) {
   notify_new_message(chan, vmu, NULL, msgnum, duration, fmt, ...
{noformat}
And if it does exist on the drive then {{notify_new_message}} is called. However, in the ODBC case voicemails are stored in the database so there is no file, the check fails, and {{notify_new_message}} is _not_ called. Subsequently the configured "mailcmd" is never called.