summaryrefslogtreecommitdiff
path: root/apps/app_hasnewvoicemail.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_hasnewvoicemail.c')
-rwxr-xr-xapps/app_hasnewvoicemail.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/app_hasnewvoicemail.c b/apps/app_hasnewvoicemail.c
index 08bcc7ac7..6d3c13e2b 100755
--- a/apps/app_hasnewvoicemail.c
+++ b/apps/app_hasnewvoicemail.c
@@ -130,9 +130,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
if (vmcount > 0) {
/* Branch to the next extension */
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
- chan->priority += 100;
- } else
+ if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
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);
}
} else {