diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet master/apps/app_queue.c queue_skipfirstthankyou/apps/app_queue.c --- master/apps/app_queue.c 2004-10-03 10:10:45 -07:00 +++ queue_skipfirstthankyou/apps/app_queue.c 2004-10-03 09:38:20 -07:00 @@ -172,6 +172,7 @@ int handled; /* Whether our call was handled */ time_t start; /* When we started holding */ int queuetimeout; /* How many seconds before timing out of queue */ + int skipfirstthankyou; /* Whether to play "thanks" message */ struct ast_channel *chan; /* Our channel */ struct queue_ent *next; /* The next queue entry */ }; @@ -196,6 +197,7 @@ int announcefrequency; /* How often to announce their position */ int roundingseconds; /* How many seconds do we round to? */ int announceholdtime; /* When to announce holdtime: 0 = never, -1 = every announcement, 1 = only once */ + int skipfirstthankyou; /* 1 to skip "thank you" with first position announcement */ int holdtime; /* Current avg holdtime for this queue, based on recursive boxcar filter */ int callscompleted; /* Number of queue calls completed */ int callsabandoned; /* Number of queue calls abandoned */ @@ -315,6 +317,7 @@ strncpy(qe->moh, q->moh, sizeof(qe->moh) - 1); strncpy(qe->announce, q->announce, sizeof(qe->announce) - 1); strncpy(qe->context, q->context, sizeof(qe->context) - 1); + qe->skipfirstthankyou = q->skipfirstthankyou; q->count++; res = 0; manager_event(EVENT_FLAG_CALL, "Join", @@ -460,7 +463,9 @@ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Told %s in %s their queue position (which was %d)\n", qe->chan->name, qe->parent->name, qe->pos); - res += play_file(qe->chan, qe->parent->sound_thanks); + if (!qe->skipfirstthankyou) + res += play_file(qe->chan, qe->parent->sound_thanks); + qe->skipfirstthankyou = 0; ast_moh_start(qe->chan, qe->moh); return (res>0); @@ -1783,6 +1788,7 @@ q->maxlen = 0; q->announcefrequency = 0; q->announceholdtime = 0; + q->skipfirstthankyou = 0; q->roundingseconds = 0; /* Default - don't announce seconds */ q->holdtime = 0; q->callscompleted = 0; @@ -1897,6 +1903,8 @@ q->leavewhenempty = ast_true(var->value); } else if (!strcasecmp(var->name, "eventwhencalled")) { q->eventwhencalled = ast_true(var->value); + } else if (!strcasecmp(var->name, "skipfirstthankyou")) { + q->skipfirstthankyou = ast_true(var->value); } else { ast_log(LOG_WARNING, "Unknown keyword in queue '%s': %s at line %d of queue.conf\n", cat, var->name, var->lineno); } diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet master/configs/queues.conf.sample queue_skipfirstthankyou/configs/queues.conf.sample --- master/configs/queues.conf.sample 2004-10-03 10:10:45 -07:00 +++ queue_skipfirstthankyou/configs/queues.conf.sample 2004-10-03 09:38:20 -07:00 @@ -75,6 +75,10 @@ ; or "less than 2 minutes" when appropriate. ; ;announce-holdtime = yes|no|once +; +; Should we include the "thank you" message (see below) with the first position announcement? +; Either yes or no. +;skipfirstthankyou = no ; ; What's the rounding time for the seconds?