summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-12-19 22:21:10 +0000
committerMark Spencer <markster@digium.com>2004-12-19 22:21:10 +0000
commit245541a8d72a0b80f47aaa3b057e850ae21a2526 (patch)
tree0aa71521a94b80ecf274a9f0eaa33af4f87ebbe7 /apps/app_queue.c
parented2d0a0eb2ccc973da682f2937ed2e62cfb5963c (diff)
Merge optimize options patch (bug #3095)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rwxr-xr-xapps/app_queue.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6312b9cfa..b01780e0e 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1140,7 +1140,6 @@ static int is_our_turn(struct queue_ent *qe)
static int wait_our_turn(struct queue_ent *qe, int ringing)
{
- struct queue_ent *ch;
int res = 0;
/* This is the holding pen for callers 2 through maxlen */
@@ -1288,24 +1287,34 @@ static int try_calling(struct queue_ent *qe, char *options, char *announceoverri
}
memset(tmp, 0, sizeof(struct localuser));
tmp->stillgoing = -1;
- if (options) {
- if (strchr(options, 't'))
+ for (; options && *options; options++)
+ switch (*options) {
+ case 't':
ast_set_flag(tmp, QUEUE_FLAG_REDIR_IN);
- if (strchr(options, 'T'))
+ break;
+ case 'T':
ast_set_flag(tmp, QUEUE_FLAG_REDIR_OUT);
- if (strchr(options, 'r'))
+ break;
+ case 'r':
ast_set_flag(tmp, QUEUE_FLAG_RINGBACKONLY);
- if (strchr(options, 'm'))
+ break;
+ case 'm':
ast_set_flag(tmp, QUEUE_FLAG_MUSICONHOLD);
- if (strchr(options, 'd'))
+ break;
+ case 'd':
ast_set_flag(tmp, QUEUE_FLAG_DATAQUALITY);
- if (strchr(options, 'h'))
+ break;
+ case 'h':
ast_set_flag(tmp, QUEUE_FLAG_DISCON_IN);
- if (strchr(options, 'H'))
+ break;
+ case 'H':
ast_set_flag(tmp, QUEUE_FLAG_DISCON_OUT);
- if ((strchr(options, 'n')) && (now - qe->start >= qe->parent->timeout))
- *go_on = 1;
- }
+ break;
+ case 'n':
+ if ((now - qe->start >= qe->parent->timeout))
+ *go_on = 1;
+ break;
+ }
if (option_debug) {
if (url)
ast_log(LOG_DEBUG, "Queue with URL=%s_\n", url);