summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2007-05-14 17:38:36 +0000
committerJason Parker <jparker@digium.com>2007-05-14 17:38:36 +0000
commit83c00e346efd90278d3b84a6bc5691b645ed157e (patch)
treec800af35129d9c3363f1cc41a9f85b619e312748 /apps
parentf02ea9e0767e1a91b89d28ae1e037df09a457936 (diff)
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') git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@64243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 0d72d9928..b46584893 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -134,6 +134,7 @@ static char *descrip =
"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 @@ static char *descrip =
"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 @@ enum queue_result {
QUEUE_JOINUNAVAIL = 4,
QUEUE_LEAVEUNAVAIL = 5,
QUEUE_FULL = 6,
+ QUEUE_CONTINUE = 7,
};
const struct {
@@ -277,6 +279,7 @@ const struct {
{ 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 @@ static int queue_exec(struct ast_channel *chan, void *data)
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 @@ static int queue_exec(struct ast_channel *chan, void *data)
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 @@ check_turns:
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",