Summary:ASTERISK-05645: [patch] app_hasnewvoicemail incorrectly reports priority n+101 does not exist
Reporter:Andrew Lindh (andrew)Labels:
Date Opened:2005-11-18 22:10:38.000-0600Date Closed:2011-06-07 14:09:59
Versions:Frequency of
Environment:Attachments:( 0) hasnewvoicemail_patch.diff.txt
Description:The app jumps, correctly, to n+101 when VM exists. But it incorrectly reports that the priority does not exist, and also reports it as n+201.

Logic on the IF statement is backwards (as far as I can see).

Patch changes the IF statement....


Not sure how far back this bug exists.
Comments:By: Jason Parker (jparker) 2005-11-18 23:26:29.000-0600

If that's the case, somebody might want to check all of these as well.

gentoo asterisk # grep -R -A1 "\!ast_goto_if_exists" * | grep -A1 101
apps/app_controlplayback.c:                             if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
apps/app_controlplayback.c-                                     ast_log(LOG_WARNING, "ControlPlayback tried to jump to priority n+101 as requested, but priority didn't exist\n");
apps/app_dial.c:                                                        if (!ast_goto_if_exists(chan, NULL, NULL, chan->priority + 101)) {
apps/app_dial.c-                                                                ast_set_flag(peerflags, OPT_GO_ON);
apps/app_groupcount.c:                          if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
apps/app_groupcount.c-                                  res = -1;
apps/app_hasnewvoicemail.c:                     if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
apps/app_hasnewvoicemail.c-                             ast_log(LOG_WARNING, "VM box %s@%s has new voicemail, but extension %s, priority %d doesn't exist\n", vmbox, context, chan->exten, chan->priority + 101);
apps/app_md5.c:         if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
apps/app_md5.c-                 if (option_debug > 2)
apps/app_md5.c-                         ast_log(LOG_DEBUG, "ERROR: Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101);
gentoo asterisk #

By: twisted (twisted) 2005-11-19 23:31:54.000-0600

i think rather than just fixing the n+101 stuff, we need to get this moved to the new variable result codes, too.

By: twisted (twisted) 2005-11-19 23:50:41.000-0600

disregard my last note.   it's late, and I'm out of RedBull...

By: Jason Parker (jparker) 2005-11-20 00:31:35.000-0600

This fixes the reported issue, but I'm still concerned about the stuff I brought up.  I'm testing some of them now.

By: twisted (twisted) 2005-11-20 00:33:41.000-0600

Fixed in CVS HEAD along with a small typo, thanks!

By: Russell Bryant (russell) 2005-11-20 18:47:37.000-0600

fixed in v1-2 as well

By: Digium Subversion (svnbot) 2008-01-15 15:56:44.000-0600

Repository: asterisk
Revision: 7139

U   trunk/ChangeLog
U   trunk/apps/app_hasnewvoicemail.c

r7139 | twisted | 2008-01-15 15:56:44 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5645



By: Digium Subversion (svnbot) 2008-01-15 15:56:59.000-0600

Repository: asterisk
Revision: 7151

U   branches/v1-2/ChangeLog
U   branches/v1-2/apps/app_hasnewvoicemail.c

r7151 | russell | 2008-01-15 15:56:59 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5645