[Asterisk-code-review] app_queue: Fix ordering problem joining queue. (asterisk[master])

Jaco Kroon asteriskteam at digium.com
Wed Apr 12 04:07:05 CDT 2023


Jaco Kroon has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/20039 )


Change subject: app_queue: Fix ordering problem joining queue.
......................................................................

app_queue: Fix ordering problem joining queue.

Introduced for ASTERISK-30437 - dereferencing qe->parent before it was
being properly set.  This should now resolve that correctly.

Apologies for not testing the submission.  Unfortunately I don't have a
dev host available right at the moment either and is under pressure to
finish other work prior to the end of the month.

Change-Id: I8047cfb1ccd006c10fdc288e12f85561b17baea0
Signed-off-by: Jaco Kroon <jaco at uls.co.za>
---
M apps/app_queue.c
1 file changed, 22 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/39/20039/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index d4362ae..a75857a 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -8523,10 +8523,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)) {
@@ -8535,6 +8531,11 @@
 		return 0;
 	}
 	ast_assert(qe.parent != NULL);
+	
+	if (qe.parent->periodicannouncestartdelay >= 0) {
+		qe.last_periodic_announce_time += qe.parent->periodicannouncestartdelay;
+		qe.last_periodic_announce_time -= qe.parent->periodicannouncefrequency;
+	}
 
 	ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ENTERQUEUE", "%s|%s|%d",
 		S_OR(args.url, ""),

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8047cfb1ccd006c10fdc288e12f85561b17baea0
Gerrit-Change-Number: 20039
Gerrit-PatchSet: 1
Gerrit-Owner: 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/20230412/dd8ab65f/attachment.html>


More information about the asterisk-code-review mailing list