aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps/app_authenticate.c3
-rwxr-xr-xapps/app_chanisavail.c4
-rwxr-xr-xapps/app_dial.c50
-rwxr-xr-xapps/app_directory.c21
-rwxr-xr-xapps/app_disa.c9
-rwxr-xr-xapps/app_groupcount.c4
-rwxr-xr-xapps/app_hasnewvoicemail.c4
-rwxr-xr-xapps/app_lookupblacklist.c5
-rwxr-xr-xapps/app_md5.c7
-rwxr-xr-xapps/app_meetme.c8
-rwxr-xr-xapps/app_osplookup.c9
-rwxr-xr-xapps/app_playback.c3
-rwxr-xr-xapps/app_privacy.c5
-rwxr-xr-xapps/app_queue.c19
-rwxr-xr-xapps/app_talkdetect.c5
-rwxr-xr-xapps/app_txtcidname.c8
-rwxr-xr-xapps/app_voicemail.c8
17 files changed, 62 insertions, 110 deletions
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c
index c9bbdf2ef..81110e90b 100755
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -174,8 +174,7 @@ static int auth_exec(struct ast_channel *chan, void *data)
if (!res)
res = ast_waitstream(chan, "");
} else {
- if (jump && ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
- chan->priority+=100;
+ if (jump && ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
res = 0;
} else {
if (!ast_streamfile(chan, "vm-goodbye", chan->language))
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index 3039f1275..34b313764 100755
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -125,9 +125,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
if (res < 1) {
pbx_builtin_setvar_helper(chan, "AVAILCHAN", "");
pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
- 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))
return -1;
}
diff --git a/apps/app_dial.c b/apps/app_dial.c
index ca72060b9..5b5711ab0 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -449,7 +449,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
if (f) {
if (f->frametype == AST_FRAME_CONTROL) {
switch(f->subclass) {
- case AST_CONTROL_ANSWER:
+ case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
if (option_verbose > 2)
@@ -558,7 +558,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
f = ast_read(in);
#if 0
if (f && (f->frametype != AST_FRAME_VOICE))
- printf("Frame type: %d, %d\n", f->frametype, f->subclass);
+ printf("Frame type: %d, %d\n", f->frametype, f->subclass);
else if (!f || (f->frametype != AST_FRAME_VOICE))
printf("Hangup received on %s\n", in->name);
#endif
@@ -806,25 +806,25 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
}
if (!timelimit) {
- timelimit=play_to_caller=play_to_callee=play_warning=warning_freq=0;
- warning_sound=NULL;
+ timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
+ warning_sound = NULL;
}
/* undo effect of S(x) in case they are both used */
- calldurationlimit=0;
+ calldurationlimit = 0;
/* more efficient do it like S(x) does since no advanced opts*/
if (!play_warning && !start_sound && !end_sound && timelimit) {
- calldurationlimit=timelimit/1000;
- timelimit=play_to_caller=play_to_callee=play_warning=warning_freq=0;
+ calldurationlimit = timelimit/1000;
+ timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
} else if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3"Limit Data:\n");
- ast_verbose(VERBOSE_PREFIX_3"timelimit=%ld\n",timelimit);
- ast_verbose(VERBOSE_PREFIX_3"play_warning=%ld\n",play_warning);
- ast_verbose(VERBOSE_PREFIX_3"play_to_caller=%s\n",play_to_caller ? "yes" : "no");
- ast_verbose(VERBOSE_PREFIX_3"play_to_callee=%s\n",play_to_callee ? "yes" : "no");
- ast_verbose(VERBOSE_PREFIX_3"warning_freq=%ld\n",warning_freq);
- ast_verbose(VERBOSE_PREFIX_3"start_sound=%s\n",start_sound ? start_sound : "UNDEF");
- ast_verbose(VERBOSE_PREFIX_3"warning_sound=%s\n",warning_sound ? warning_sound : "UNDEF");
- ast_verbose(VERBOSE_PREFIX_3"end_sound=%s\n",end_sound ? end_sound : "UNDEF");
+ ast_verbose(VERBOSE_PREFIX_3 "Limit Data for this call:\n");
+ ast_verbose(VERBOSE_PREFIX_3 "- timelimit = %ld\n", timelimit);
+ ast_verbose(VERBOSE_PREFIX_3 "- play_warning = %ld\n", play_warning);
+ ast_verbose(VERBOSE_PREFIX_3 "- play_to_caller= %s\n", play_to_caller ? "yes" : "no");
+ ast_verbose(VERBOSE_PREFIX_3 "- play_to_callee= %s\n", play_to_callee ? "yes" : "no");
+ ast_verbose(VERBOSE_PREFIX_3 "- warning_freq = %ld\n", warning_freq);
+ ast_verbose(VERBOSE_PREFIX_3 "- start_sound = %s\n", start_sound ? start_sound : "UNDEF");
+ ast_verbose(VERBOSE_PREFIX_3 "- warning_sound = %s\n", warning_sound ? warning_sound : "UNDEF");
+ ast_verbose(VERBOSE_PREFIX_3 "- end_sound = %s\n", end_sound ? end_sound : "UNDEF");
}
}
@@ -1000,15 +1000,12 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
goto out;
}
else if( privdb_val == AST_PRIVACY_KILL ) {
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 201, chan->cid.cid_num))
- chan->priority+=200;
-
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
res = 0;
goto out; /* Is this right? */
}
else if( privdb_val == AST_PRIVACY_TORTURE ) {
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 301, chan->cid.cid_num))
- chan->priority+=300;
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
res = 0;
goto out; /* is this right??? */
@@ -1252,13 +1249,12 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (!peer) {
if (result) {
res = result;
- }
- else if (to)
+ } else if (to)
/* Musta gotten hung up */
res = -1;
else
/* Nobody answered, next please? */
- res=0;
+ res = 0;
goto out;
}
@@ -1482,7 +1478,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
res = ast_autoservice_start(chan);
/* Now Stream the File */
if (!res)
- res = ast_streamfile(peer,announcemsg,peer->language);
+ res = ast_streamfile(peer, announcemsg, peer->language);
if (!res) {
digit = ast_waitstream(peer, AST_DIGIT_ANY);
}
@@ -1497,7 +1493,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
res = 0;
if (chan && peer && dblgoto) {
- for (mac=dblgoto; *mac; mac++) {
+ for (mac = dblgoto; *mac; mac++) {
if(*mac == '^') {
*mac = '|';
}
@@ -1521,7 +1517,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
app = pbx_findapp("Macro");
if (app && !res) {
- for (res=0;res<strlen(macroname);res++)
+ for (res = 0; res<strlen(macroname); res++)
if (macroname[res] == '^')
macroname[res] = '|';
res = pbx_exec(peer, app, macroname, 1);
diff --git a/apps/app_directory.c b/apps/app_directory.c
index ad21736c4..2c1729ef2 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -182,11 +182,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
case '1':
/* Name selected */
loop = 0;
- if (ast_exists_extension(chan,dialcontext,ext,1,chan->cid.cid_num)) {
- ast_copy_string(chan->exten, ext, sizeof(chan->exten));
- chan->priority = 0;
- ast_copy_string(chan->context, dialcontext, sizeof(chan->context));
- } else {
+ if (!ast_goto_if_exists(chan, dialcontext, ext, 1)) {
ast_log(LOG_WARNING,
"Can't find extension '%s' in context '%s'. "
"Did you pass the wrong context to Directory?\n",
@@ -293,11 +289,8 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
return -1;
}
if (digit == '0') {
- if (ast_exists_extension(chan,chan->context,"o",1,chan->cid.cid_num) ||
- (!ast_strlen_zero(chan->macrocontext) &&
- ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num))) {
- strcpy(chan->exten, "o");
- chan->priority = 0;
+ if (ast_goto_if_exists(chan, chan->context, "o", 1) ||
+ (!ast_strlen_zero(chan->macrocontext) && ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
return 0;
} else {
@@ -307,14 +300,10 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
}
}
if (digit == '*') {
- if (ast_exists_extension(chan,chan->context,"a",1,chan->cid.cid_num) ||
- (!ast_strlen_zero(chan->macrocontext) &&
- ast_exists_extension(chan, chan->macrocontext, "a", 1, chan->cid.cid_num))) {
- strcpy(chan->exten, "a");
- chan->priority = 0;
+ if (ast_goto_if_exists(chan, chan->context, "a", 1) ||
+ (!ast_strlen_zero(chan->macrocontext) && ast_goto_if_exists(chan, chan->macrocontext, "a", 1))) {
return 0;
} else {
-
ast_log(LOG_WARNING, "Can't find extension 'a' in current context. "
"Not Exiting the Directory!\n");
res = 0;
diff --git a/apps/app_disa.c b/apps/app_disa.c
index 9f6977629..47ef714bd 100755
--- a/apps/app_disa.c
+++ b/apps/app_disa.c
@@ -318,7 +318,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
}
}
- if (k==3 && ast_exists_extension(chan,ourcontext,exten,1, chan->cid.cid_num))
+ if (k==3 && ast_exists_extension(chan, ourcontext, exten, 1, chan->cid.cid_num))
{
ast_playtones_stop(chan);
/* We're authenticated and have a valid extension */
@@ -327,13 +327,12 @@ static int disa_exec(struct ast_channel *chan, void *data)
ast_callerid_split(ourcallerid, ourcidname, sizeof(ourcidname), ourcidnum, sizeof(ourcidnum));
ast_set_callerid(chan, ourcidnum, ourcidname, ourcidnum);
}
- strncpy(chan->exten, exten, sizeof(chan->exten) - 1);
- strncpy(chan->context, ourcontext, sizeof(chan->context) - 1);
+
if (!ast_strlen_zero(acctcode)) {
strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1);
}
- chan->priority = 0;
- ast_cdr_reset(chan->cdr,AST_CDR_FLAG_POSTED);
+ ast_cdr_reset(chan->cdr, AST_CDR_FLAG_POSTED);
+ ast_goto_if_exists(chan, ourcontext, exten, 1);
LOCAL_USER_REMOVE(u);
return 0;
}
diff --git a/apps/app_groupcount.c b/apps/app_groupcount.c
index 57c00c820..736572fdd 100755
--- a/apps/app_groupcount.c
+++ b/apps/app_groupcount.c
@@ -146,9 +146,7 @@ static int group_check_exec(struct ast_channel *chan, void *data)
if ((sscanf(limit, "%d", &max) == 1) && (max > -1)) {
count = ast_app_group_get_count(pbx_builtin_getvar_helper(chan, category), category);
if (count > max) {
- 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))
res = -1;
}
} else
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 {
diff --git a/apps/app_lookupblacklist.c b/apps/app_lookupblacklist.c
index 278f27452..c8034499c 100755
--- a/apps/app_lookupblacklist.c
+++ b/apps/app_lookupblacklist.c
@@ -76,8 +76,9 @@ lookupblacklist_exec (struct ast_channel *chan, void *data)
}
}
- if (bl && ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority+=100;
+ if (bl)
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
+
LOCAL_USER_REMOVE (u);
return 0;
}
diff --git a/apps/app_md5.c b/apps/app_md5.c
index 0e92c1c99..55e2a4540 100755
--- a/apps/app_md5.c
+++ b/apps/app_md5.c
@@ -118,10 +118,9 @@ static int md5check_exec(struct ast_channel *chan, void *data)
}
if (option_debug > 2)
ast_log(LOG_DEBUG, "ERROR: MD5 not verified: %s -- %s\n", hash, string);
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority += 100;
- else if (option_debug > 2)
- ast_log(LOG_DEBUG, "ERROR: Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101);
+ if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
+ if (option_debug > 2)
+ ast_log(LOG_DEBUG, "ERROR: Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101);
LOCAL_USER_REMOVE(u);
return res;
}
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 95aaadd32..4ff89843a 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -1263,13 +1263,11 @@ zapretry:
char tmp[2];
tmp[0] = f->subclass;
tmp[1] = '\0';
- if (ast_exists_extension(chan, exitcontext, tmp, 1, chan->cid.cid_num)) {
- ast_copy_string(chan->context, exitcontext, sizeof(chan->context));
- ast_copy_string(chan->exten, tmp, sizeof(chan->exten));
- chan->priority = 0;
+ if (ast_goto_if_exists(chan, exitcontext, tmp, 1)) {
ret = 0;
break;
- }
+ } else if (option_debug > 1)
+ ast_log(LOG_DEBUG, "Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", tmp, exitcontext);
} else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#') && (confflags & CONFFLAG_POUNDEXIT)) {
ret = 0;
break;
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index 72eded69e..b4e0f8a8c 100755
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -132,8 +132,7 @@ static int osplookup_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Look for a "busy" place */
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority += 100;
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0)
res = 0;
LOCAL_USER_REMOVE(u);
@@ -176,8 +175,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Look for a "busy" place */
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority += 100;
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0)
res = 0;
LOCAL_USER_REMOVE(u);
@@ -223,8 +221,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Look for a "busy" place */
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority += 100;
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0)
res = 0;
LOCAL_USER_REMOVE(u);
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 7e7cabe5b..ce2ff4a34 100755
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -93,8 +93,7 @@ static int playback_exec(struct ast_channel *chan, void *data)
ast_stopstream(chan);
} else {
ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data);
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority+=100;
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
res = 0;
}
front = back;
diff --git a/apps/app_privacy.c b/apps/app_privacy.c
index cb2bb01f7..78d9d4acf 100755
--- a/apps/app_privacy.c
+++ b/apps/app_privacy.c
@@ -144,9 +144,8 @@ privacy_exec (struct ast_channel *chan, void *data)
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID to %s\n",phone);
} else {
- /*Send the call to n+101 priority, where n is the current priority*/
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority+=100;
+ /* Send the call to n+101 priority, where n is the current priority */
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
}
if (cfg)
ast_config_destroy(cfg);
diff --git a/apps/app_queue.c b/apps/app_queue.c
index ccc850af1..e5fcb5ced 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1007,10 +1007,7 @@ static int valid_exit(struct queue_ent *qe, char digit)
}
/* We have an exact match */
- if (ast_exists_extension(qe->chan, qe->context, qe->digits, 1, qe->chan->cid.cid_num)) {
- ast_copy_string(qe->chan->context, qe->context, sizeof(qe->chan->context));
- ast_copy_string(qe->chan->exten, qe->digits, sizeof(qe->chan->exten));
- qe->chan->priority = 0;
+ if (ast_goto_if_exists(qe->chan, qe->context, qe->digits, 1)) {
return 1;
}
return 0;
@@ -2546,8 +2543,7 @@ static int pqm_exec(struct ast_channel *chan, void *data)
if (set_member_paused(queuename, interface, 1)) {
ast_log(LOG_WARNING, "Attempt to pause interface %s, not found\n", interface);
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
- chan->priority += 100;
+ if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
LOCAL_USER_REMOVE(u);
return 0;
}
@@ -2588,8 +2584,7 @@ static int upqm_exec(struct ast_channel *chan, void *data)
if (set_member_paused(queuename, interface, 0)) {
ast_log(LOG_WARNING, "Attempt to unpause interface %s, not found\n", interface);
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
- chan->priority += 100;
+ if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
LOCAL_USER_REMOVE(u);
return 0;
}
@@ -2645,9 +2640,7 @@ static int rqm_exec(struct ast_channel *chan, void *data)
break;
case RES_EXISTS:
ast_log(LOG_WARNING, "Unable to remove interface '%s' from queue '%s': Not there\n", interface, queuename);
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
- chan->priority += 100;
- }
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
res = 0;
break;
case RES_NOSUCHQUEUE:
@@ -2722,9 +2715,7 @@ static int aqm_exec(struct ast_channel *chan, void *data)
break;
case RES_EXISTS:
ast_log(LOG_WARNING, "Unable to add interface '%s' to queue '%s': Already there\n", interface, queuename);
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
- chan->priority += 100;
- }
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
res = 0;
break;
case RES_NOSUCHQUEUE:
diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c
index e60f3a8e9..7a76250e5 100755
--- a/apps/app_talkdetect.c
+++ b/apps/app_talkdetect.c
@@ -155,10 +155,7 @@ static int background_detect_exec(struct ast_channel *chan, void *data)
sprintf(ms_str, "%d", ms );
pbx_builtin_setvar_helper(chan, "TALK_DETECTED", ms_str);
- if (ast_exists_extension(chan, chan->context, "talk", 1, chan->cid.cid_num)) {
- ast_copy_string(chan->exten, "talk", sizeof(chan->exten));
- chan->priority = 0;
- }
+ ast_goto_if_exists(chan, chan->context, "talk", 1);
res = 0;
ast_frfree(fr);
break;
diff --git a/apps/app_txtcidname.c b/apps/app_txtcidname.c
index d018cbd92..73baddbb0 100755
--- a/apps/app_txtcidname.c
+++ b/apps/app_txtcidname.c
@@ -73,15 +73,13 @@ static int txtcidname_exec(struct ast_channel *chan, void *data)
if (res > 0) {
if (!ast_strlen_zero(txt)) {
pbx_builtin_setvar_helper(chan, "TXTCIDNAME", txt);
-#if 0
- ast_log(LOG_DEBUG, "TXTCIDNAME got '%s'\n", txt);
-#endif
+ if (option_debug > 1)
+ ast_log(LOG_DEBUG, "TXTCIDNAME got '%s'\n", txt);
}
}
if (!res) {
/* Look for a "busy" place */
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
- chan->priority += 100;
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0)
res = 0;
return res;
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c9003c6e8..ebed7dd49 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5474,9 +5474,7 @@ static int vm_exec(struct ast_channel *chan, void *data)
if (res == ERROR_LOCK_PATH) {
ast_log(LOG_ERROR, "Could not leave voicemail. The path is already locked.\n");
/*Send the call to n+101 priority, where n is the current priority*/
- 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, "Extension %s, priority %d doesn't exist.\n", chan->exten, chan->priority + 101);
res = 0;
}
@@ -5542,9 +5540,7 @@ static int vm_box_exists(struct ast_channel *chan, void *data)
}
if (find_user(&svm, context, box)) {
- 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 exists, but extension %s, priority %d doesn't exist\n", box, context, chan->exten, chan->priority + 101);
}
LOCAL_USER_REMOVE(u);