diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet master/apps/app_queue.c queue_memberdelay/apps/app_queue.c --- master/apps/app_queue.c 2004-10-03 13:26:54 -07:00 +++ queue_memberdelay/apps/app_queue.c 2004-10-03 14:09:51 -07:00 @@ -229,6 +229,7 @@ int eventwhencalled; /* Generate an event when the agent is called (before pickup) */ int leavewhenempty; /* If all agents leave the queue, remove callers from the queue */ int reportholdtime; /* Should we report caller hold time to member? */ + int memberdelay; /* Seconds to delay connecting member to caller */ struct member *members; /* Member channels to be tried */ struct queue_ent *head; /* Start of the actual queue */ @@ -1162,10 +1163,21 @@ member = lpeer->member; hanguptree(outgoing, peer); outgoing = NULL; - if (announce || qe->parent->reportholdtime) { + if (announce || qe->parent->reportholdtime || qe->parent->memberdelay) { int res2; res2 = ast_autoservice_start(qe->chan); if (!res2) { + if (qe->parent->memberdelay) { + ast_log(LOG_NOTICE, "Delaying member connect for %d seconds\n", qe->parent->memberdelay); + res = ast_safe_sleep(peer, qe->parent->memberdelay * 1000); + if (res) { + /* Agent must have hung up */ + ast_log(LOG_WARNING, "Agent on %s hungup on the customer. They're going to be pissed.\n", peer->name); + ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", ""); + ast_hangup(peer); + return -1; + } + } if (announce) { if (play_file(peer, announce)) ast_log(LOG_WARNING, "Announcement file '%s' is unavailable, continuing anyway...\n", announce); @@ -1916,6 +1928,8 @@ q->eventwhencalled = ast_true(var->value); } else if (!strcasecmp(var->name, "reportholdtime")) { q->reportholdtime = ast_true(var->value); + } else if (!strcasecmp(var->name, "memberdelay")) { + q->memberdelay = atoi(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_memberdelay/configs/queues.conf.sample --- master/configs/queues.conf.sample 2004-10-03 13:26:54 -07:00 +++ queue_memberdelay/configs/queues.conf.sample 2004-10-03 13:26:47 -07:00 @@ -130,6 +130,11 @@ ; reportholdtime = no ; ; +; If you wish to have a delay before the member is connected to the caller (or before the member +; hears any announcement messages), set this to the number of seconds to delay. +; +; memberdelay = 0 +; ; Each member of this call queue is listed on a separate line in ; the form technology/dialstring. "member" means a normal member of a ; queue. An optional penalty may be specified after a comma, such that