[asterisk-commits] qwell: trunk r64243 - /trunk/apps/app_queue.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 14 10:38:36 MST 2007


Author: qwell
Date: Mon May 14 12:38:36 2007
New Revision: 64243

URL: http://svn.digium.com/view/asterisk?view=rev&rev=64243
Log:
Add 'c' option to app_queue which allows for continuing in the dialplan if the callee hangs up.

Issue 9284, patch by lyl, modified a little bit by me (I felt 'continue' was better than 'keepalive')

Modified:
    trunk/apps/app_queue.c

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=64243&r1=64242&r2=64243
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon May 14 12:38:36 2007
@@ -134,6 +134,7 @@
 "This application will return to the dialplan if the queue does not exist, or\n"
 "any of the join options cause the caller to not enter the queue.\n"
 "The option string may contain zero or more of the following characters:\n"
+"      'c' -- continue in the dialplan if the callee hangs up.\n"
 "      'd' -- data-quality (modem) call (minimum delay).\n"
 "      'h' -- allow callee to hang up by pressing *.\n"
 "      'H' -- allow caller to hang up by pressing *.\n"
@@ -158,7 +159,7 @@
 "seconds, checked between each queues.conf 'timeout' and 'retry' cycle.\n"
 "  This application sets the following channel variable upon completion:\n"
 "      QUEUESTATUS    The status of the call as a text string, one of\n"
-"             TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL\n";
+"             TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL | CONTINUE\n";
 
 static char *app_aqm = "AddQueueMember" ;
 static char *app_aqm_synopsis = "Dynamically adds queue members" ;
@@ -264,6 +265,7 @@
 	QUEUE_JOINUNAVAIL = 4,
 	QUEUE_LEAVEUNAVAIL = 5,
 	QUEUE_FULL = 6,
+	QUEUE_CONTINUE = 7,
 };
 
 const struct {
@@ -277,6 +279,7 @@
 	{ QUEUE_JOINUNAVAIL, "JOINUNAVAIL" },
 	{ QUEUE_LEAVEUNAVAIL, "LEAVEUNAVAIL" },
 	{ QUEUE_FULL, "FULL" },
+	{ QUEUE_CONTINUE, "CONTINUE" },
 };
 
 /*! \brief We define a custom "local user" structure because we
@@ -3409,6 +3412,7 @@
 	const char *user_priority;
 	const char *max_penalty_str;
 	int prio;
+	int qcontinue = 0;
 	int max_penalty;
 	enum queue_result reason = QUEUE_UNKNOWN;
 	/* whether to exit Queue application after the timeout hits */
@@ -3482,6 +3486,9 @@
 	if (args.options && (strchr(args.options, 'r')))
 		ringing = 1;
 
+	if (args.options && (strchr(args.options, 'c')))
+		qcontinue = 1;
+
 	if (option_debug)
 		ast_log(LOG_DEBUG, "queue: %s, options: %s, url: %s, announce: %s, expires: %ld, priority: %d\n",
 			args.queuename, args.options, args.url, args.announceoverride, (long)qe.expire, prio);
@@ -3576,6 +3583,9 @@
 							ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON",
 								"%d|%d|%ld", qe.pos, qe.opos,
 								(long) time(NULL) - qe.start);
+						} else if (qcontinue) {
+							reason = QUEUE_CONTINUE;
+							res = 0;
 						}
 					} else if (valid_exit(&qe, res)) {
 						ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d|%d|%ld", 



More information about the asterisk-commits mailing list