[Asterisk-code-review] Revert "app_queue: periodic announcement configurable start time." (asterisk[20])

Joshua Colp asteriskteam at digium.com
Tue Apr 11 18:37:40 CDT 2023


Attention is currently required from: George Joseph, Benjamin Keith Ford, Jaco Kroon.

Hello George Joseph, Friendly Automation, Benjamin Keith Ford, Jaco Kroon,

I'd like you to do a code review.
Please visit

    https://gerrit.asterisk.org/c/asterisk/+/20062

to review the following change.


Change subject: Revert "app_queue: periodic announcement configurable start time."
......................................................................

Revert "app_queue: periodic announcement configurable start time."

This reverts commit 3fd0b65bae4b1b14434737ffcf0da4aa9ff717f6.

Reason for revert: Causes segmentation fault.

Change-Id: Ic189c6f7872943a5500d3e71142f0c09d54fcc31
---
M apps/app_queue.c
M configs/samples/queues.conf.sample
D doc/CHANGES-staging/app_queue.txt
3 files changed, 13 insertions(+), 24 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/20062/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index d2de993..f549af7 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1856,7 +1856,6 @@
 	int announcepositionlimit;          /*!< How many positions we announce? */
 	int announcefrequency;              /*!< How often to announce their position */
 	int minannouncefrequency;           /*!< The minimum number of seconds between position announcements (def. 15) */
-	int periodicannouncestartdelay;     /*!< How long into the queue should the periodic accouncement start */
 	int periodicannouncefrequency;      /*!< How often to play periodic announcement */
 	int numperiodicannounce;            /*!< The number of periodic announcements configured */
 	int randomperiodicannounce;         /*!< Are periodic announcments randomly chosen */
@@ -2988,7 +2987,6 @@
 	q->weight = 0;
 	q->timeoutrestart = 0;
 	q->periodicannouncefrequency = 0;
-	q->periodicannouncestartdelay = -1;
 	q->randomperiodicannounce = 0;
 	q->numperiodicannounce = 0;
 	q->relativeperiodicannounce = 0;
@@ -3447,8 +3445,6 @@
 			ast_str_set(&q->sound_periodicannounce[0], 0, "%s", val);
 			q->numperiodicannounce = 1;
 		}
-	} else if (!strcasecmp(param, "periodic-announce-startdelay")) {
-		q->periodicannouncestartdelay = atoi(val);
 	} else if (!strcasecmp(param, "periodic-announce-frequency")) {
 		q->periodicannouncefrequency = atoi(val);
 	} else if (!strcasecmp(param, "relative-periodic-announce")) {
@@ -8617,10 +8613,6 @@
 	qe.last_pos_said = 0;
 	qe.last_pos = 0;
 	qe.last_periodic_announce_time = time(NULL);
-	if (qe.parent->periodicannouncestartdelay >= 0) {
-		qe.last_periodic_announce_time += qe.parent->periodicannouncestartdelay;
-		qe.last_periodic_announce_time -= qe.parent->periodicannouncefrequency;
-	}
 	qe.last_periodic_announce_sound = 0;
 	qe.valid_digits = 0;
 	if (join_queue(args.queuename, &qe, &reason, position)) {
diff --git a/configs/samples/queues.conf.sample b/configs/samples/queues.conf.sample
index d8308ca..fbb5653 100644
--- a/configs/samples/queues.conf.sample
+++ b/configs/samples/queues.conf.sample
@@ -291,13 +291,6 @@
 ;
 ;periodic-announce-frequency=60
 ;
-; If given indicates the number of seconds after entering the queue the first
-; periodic announcement should be played.  The default (and historic) behavior
-; is to play the first periodic announcement at periodic-announce-frequency
-; seconds after entering the queue.
-;
-;periodic-announce-startdelay=10
-;
 ; Should the periodic announcements be played in a random order? Default is no.
 ;
 ;random-periodic-announce=no
diff --git a/doc/CHANGES-staging/app_queue.txt b/doc/CHANGES-staging/app_queue.txt
deleted file mode 100644
index f71bcb0..0000000
--- a/doc/CHANGES-staging/app_queue.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Subject: app_queue
-
-Introduce a new queue configuration option called
-'periodic-announce-startdelay' which will vary the normal (historic) behavior
-of starting the periodic announcement cycle at periodic-announce-frequency
-seconds after entering the queue to start the periodic announcement cycle at
-period-announce-startdelay seconds after joining the queue.
-
-The default behavior if this config option is not set remains unchanged.

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/20062
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 20
Gerrit-Change-Id: Ic189c6f7872943a5500d3e71142f0c09d54fcc31
Gerrit-Change-Number: 20062
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jaco Kroon <jaco at uls.co.za>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Attention: Benjamin Keith Ford <bford at digium.com>
Gerrit-Attention: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230411/e860e50b/attachment-0001.html>


More information about the asterisk-code-review mailing list