summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorIvan Poddubny <ivan.poddubny@gmail.com>2017-06-27 11:37:11 +0200
committerIvan Poddubny <ivan.poddubny@gmail.com>2017-06-29 09:51:50 -0500
commit2c43ca0ac50764ab17d691844a84158bbf590b0e (patch)
tree664e86b563e5473b4f1432174272037c4416f293 /apps/app_queue.c
parent997c11235e6f6fe9dce285bdd6b199b450aed2bc (diff)
app_queue: Fix returning to dialplan when a queue is empty
The fix for ASTERISK-25665 introduced a regression. The return value of queue_exec used to be 0 in case of leavewhenempty but it was changed to -1 (returned from wait_our_turn and passed transparently by queue_exec), thus leading to hangup instead of returning back to dialplan. This commit resets the value back to 0 in this case, restoring original behavior. ASTERISK-27065 #close Reported by: Marek Cervenka Change-Id: Id9c83b75aeda463250155e88c5004be52bbca5ac
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index b449263c9..ac4738fd2 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -8166,6 +8166,9 @@ stop:
} else if (qcontinue) {
reason = QUEUE_CONTINUE;
res = 0;
+ } else if (reason == QUEUE_LEAVEEMPTY) {
+ /* Return back to dialplan, don't hang up */
+ res = 0;
}
} else if (qe.valid_digits) {
ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",