diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-09-07 19:13:00 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-09-07 19:13:00 +0000 |
commit | e0f02b46f1b18d2cdd5f218db49f9dcb1fe6d3a6 (patch) | |
tree | 09d54e0b28af50c87bac02b87c93c36feb721cf9 /apps/app_queue.c | |
parent | 1bd1a35a9affaea7bd47d81bc022194c8559b8f0 (diff) |
convert a bunch of apps to use ast_goto_if_exists() (issue #5138)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rwxr-xr-x | apps/app_queue.c | 19 |
1 files changed, 5 insertions, 14 deletions
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: |