[asterisk-bugs] [JIRA] Commented: (ASTERISK-20435) app_voicemail deletes the wrong greeting if both an unavailable and a temporary greeting is available and imap greetings are used

Matt Jordan (JIRA) noreply at issues.asterisk.org
Tue Sep 18 09:25:27 CDT 2012


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

Matt Jordan commented on ASTERISK-20435:
----------------------------------------

Yup, that is the intent there.  The problem is that you can't use {{msgnum}} (with a value of -1, which indicates you want to delete a greeting) to index into the msgArray - not only are you indexing into an array using a negative number (yikes!) but you have to use the value of {{vms->curmsg}} to delete the 'current' message that was retrieved from the IMAP backend.  Note that the 'current' message retrieved from the IMAP backend occurs prior to the call to {{vm_imap_delete}} in {{imap_retrieve_file}}/{{imap_retrieve_greeting}}.  The whole flow should go something like:

* Call {{imap_retrieve_file}}
** If the message being retrieved is a greeting, call {{imap_retrieve_greeting}}.  This sets the entry in the array at {{vms->curmsg}} to the actual greeting message.
** If the message being retrieved is not a greeting, then msgnum will reference an actual message in the msgArray that was earlier retrieved from the IMAP backend.
* Call {{vm_imap_delete}}
** If {{msgnum}} is -1, then delete the appropriate greeting message using {{vms->curmsg}}
** If {{msgnum}} is not -1, then delete the appropriate non-greeting message using {{msgnum}}





> app_voicemail deletes the wrong greeting if both an unavailable and a temporary greeting is available and imap greetings are used
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-20435
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20435
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_voicemail/IMAP
>    Affects Versions: 1.8.16.0
>            Reporter: fhackenberger
>         Attachments: msgnum_negative.patch
>
>
> Set up voicemail with imap and imapgreetings=yes in voicemail.conf
> Dial into VoiceMailMain and do the following:
> * Record an unavail greeting
> * Hangup
> * Record a temp greeting
> * Hangup
> * Delete a temp greeting (BUG: it deletes the unavailable greeting)
> The bug seems to be that vm_imap_delete uses the msgnum parameter as an index into vms->msgArray even if it is negative, which is certainly wrong. I assume (talked to mjordan on IRC) that passing - 1 as the msgnum indicates that the current message should be deleted (vms->curmsg). The attached patch fixes that. It issue is present in 1.6 (where I debugged the issue) as well as the current 1.8 branch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list