From 2d1b06faef31c408bc552fb0a8b859280710a3d4 Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Mon, 14 May 2007 18:08:54 +0000 Subject: [PATCH] Don't allow rounding seconds to weird values that may cause "unexpected" results. Issue 9514. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@64263 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 4 +++- configs/queues.conf.sample | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index b465848937..88a212931a 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -859,7 +859,9 @@ static void queue_set_param(struct call_queue *q, const char *param, const char ast_log(LOG_DEBUG, "%s=%s for queue '%s'\n", param, val, q->name); } else if (!strcasecmp(param, "announce-round-seconds")) { q->roundingseconds = atoi(val); - if (q->roundingseconds>60 || q->roundingseconds<0) { + /* Rounding to any other values just doesn't make sense... */ + if (!(q->roundingseconds == 0 || q->roundingseconds == 1 || q->roundingseconds == 5 || q->roundingseconds == 10 + || q->roundingseconds == 15 || q->roundingseconds == 20 || q->roundingseconds == 30)) { if (linenum >= 0) { ast_log(LOG_WARNING, "'%s' isn't a valid value for %s " "using 0 instead for queue '%s' at line %d of queues.conf\n", diff --git a/configs/queues.conf.sample b/configs/queues.conf.sample index 4746308520..e5d8131e81 100644 --- a/configs/queues.conf.sample +++ b/configs/queues.conf.sample @@ -195,6 +195,7 @@ monitor-type = MixMonitor ; What's the rounding time for the seconds? ; If this is non-zero, then we announce the seconds as well as the minutes ; rounded to this value. +; Value values are 0, 1, 5, 10, 15, 20, and 30. ; ; announce-round-seconds = 10 ; -- 2.47.2