[Asterisk-cvs] asterisk/apps app_queue.c,1.89,1.90

markster at lists.digium.com markster at lists.digium.com
Sun Oct 3 16:35:26 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv24433/apps

Modified Files:
	app_queue.c 
Log Message:
Merge member delay patch (bug #2563)


Index: app_queue.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_queue.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- app_queue.c	3 Oct 2004 16:46:06 -0000	1.89
+++ app_queue.c	3 Oct 2004 20:37:09 -0000	1.90
@@ -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,15 +1163,19 @@
 		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 (announce) {
+				if (qe->parent->memberdelay) {
+					ast_log(LOG_NOTICE, "Delaying member connect for %d seconds\n", qe->parent->memberdelay);
+					res2 |= ast_safe_sleep(peer, qe->parent->memberdelay * 1000);
+				}
+				if (!res2 && announce) {
 					if (play_file(peer, announce))
 						ast_log(LOG_WARNING, "Announcement file '%s' is unavailable, continuing anyway...\n", announce);
 				}
-				if (qe->parent->reportholdtime) {
+				if (!res2 && qe->parent->reportholdtime) {
 					if (!play_file(peer, qe->parent->sound_reporthold)) {
 						int holdtime;
 						time_t now;
@@ -1916,6 +1921,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);
 					}




More information about the svn-commits mailing list