aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2004-02-03 00:53:21 +0000
committermartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2004-02-03 00:53:21 +0000
commit9697fe58e47191b0c84205a9931065d534afd484 (patch)
tree2a400c4dae407079a7965a68d6c1d5598efbe306
parent682cc8d8e8866618cd738cb88771bf19c4e0c061 (diff)
Make the go_on be non-global.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2118 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_queue.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 4844df98a..446b26422 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -100,10 +100,6 @@ static char *app_rqm_descrip =
"Example: RemoveQueueMember(techsupport|SIP/3000)\n"
"";
-/* whether to exit Queue application after the timeout hits */
-static int go_on = 0;
-
-
/* We define a customer "local user" structure because we
use it not only for keeping track of what is in use but
also for keeping track of who we're dialing. */
@@ -694,7 +690,7 @@ static int calc_metric(struct ast_call_queue *q, struct member *mem, int pos, st
return 0;
}
-static int try_calling(struct queue_ent *qe, char *options, char *announceoverride, char *url)
+static int try_calling(struct queue_ent *qe, char *options, char *announceoverride, char *url, int *go_on)
{
struct member *cur;
struct localuser *outgoing=NULL, *tmp = NULL;
@@ -742,7 +738,7 @@ static int try_calling(struct queue_ent *qe, char *options, char *announceoverri
if (strchr(options, 'H'))
tmp->allowdisconnect = 1;
if (strchr(options, 'n'))
- go_on = 1;
+ *go_on = 1;
}
if (url) {
ast_log(LOG_DEBUG, "Queue with URL=%s_\n", url);
@@ -1100,7 +1096,11 @@ static int queue_exec(struct ast_channel *chan, void *data)
char *options = NULL;
char *url = NULL;
char *announceoverride = NULL;
-
+ /* whether to exit Queue application after the timeout hits */
+ int go_on = 0;
+
+
+
/* Our queue entry */
struct queue_ent qe;
@@ -1158,14 +1158,9 @@ static int queue_exec(struct ast_channel *chan, void *data)
}
if (!res) {
for (;;) {
- res = try_calling(&qe, options, announceoverride, url);
+ res = try_calling(&qe, options, announceoverride, url, &go_on);
if (res)
break;
- /* exit after a timeout if 'n' option enabled */
- if (go_on) {
- res = 0;
- break;
- }
res = wait_a_bit(&qe);
if (res < 0) {
if (option_verbose > 2) {
@@ -1176,6 +1171,12 @@ static int queue_exec(struct ast_channel *chan, void *data)
}
if (res && valid_exit(&qe, res))
break;
+
+ /* exit after a timeout if 'n' option enabled */
+ if (go_on) {
+ res = 0;
+ break;
+ }
}
}
/* Don't allow return code > 0 */