[Asterisk-code-review] Add feature set announce-position-only-up for caller list (asterisk[master])
Rodrigo Ramirez Norambuena
asteriskteam at digium.com
Mon Jun 19 11:07:33 CDT 2017
Rodrigo Ramirez Norambuena has uploaded this change for review. ( https://gerrit.asterisk.org/5880
Change subject: Add feature set announce-position-only-up for caller list
......................................................................
Add feature set announce-position-only-up for caller list
Change-Id: I173a124121422209485b043e2bf784f54242fce6
---
M apps/app_queue.c
M configs/samples/queues.conf.sample
2 files changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/80/5880/1
diff --git a/apps/app_queue.c b/apps/app_queue.c
index ae2d645..7731e70 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1669,6 +1669,7 @@
unsigned int timeoutrestart:1;
unsigned int announceholdtime:2;
unsigned int announceposition:3;
+ unsigned int announcepositiononlyup:1; /* Say position if only the change if up not down on caller positions*/
int strategy:4;
unsigned int realtime:1;
unsigned int found:1;
@@ -3124,6 +3125,8 @@
} else {
q->announceposition = ANNOUNCEPOSITION_NO;
}
+ } else if (!strcasecmp(param, "announce-position-only-up")) {
+ q->announcepositiononlyup = ast_true(val);
} else if (!strcasecmp(param, "announce-position-limit")) {
q->announcepositionlimit = atoi(val);
} else if (!strcasecmp(param, "periodic-announce")) {
@@ -3864,6 +3867,11 @@
return 0;
}
+ /* If position has change but if set announce-position-only-up and the last position said is lower */
+ if (qe->parent->announcepositiononlyup && (qe->last_pos_said < qe->pos)) {
+ return 0;
+ }
+
if (ringing) {
ast_indicate(qe->chan,-1);
} else {
diff --git a/configs/samples/queues.conf.sample b/configs/samples/queues.conf.sample
index ebb5da1..6ea2030 100644
--- a/configs/samples/queues.conf.sample
+++ b/configs/samples/queues.conf.sample
@@ -97,7 +97,7 @@
; fewestcalls - ring the one with fewest completed calls from this queue
; random - ring random interface
; rrmemory - round robin with memory, remember where we left off last ring pass
-; rrordered - same as rrmemory, except the queue member order from config file
+; rrordered - same as rrmemory, except the queue member order from config file
; is preserved
; linear - rings interfaces in the order specified in this configuration file.
; If you use dynamic members, the members will be rung in the order in
@@ -345,6 +345,11 @@
;
; announce-round-seconds = 10
;
+; Only need say the position is up in caller list?
+; If set to yes, the announce of the position only when is up
+;
+; announce-position-only-up = no
+;
; Use these sound files in making position/holdtime announcements. The
; defaults are as listed below -- change only if you need to.
;
--
To view, visit https://gerrit.asterisk.org/5880
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I173a124121422209485b043e2bf784f54242fce6
Gerrit-Change-Number: 5880
Gerrit-PatchSet: 1
Gerrit-Owner: Rodrigo Ramirez Norambuena <a at rodrigoramirez.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170619/d08ce4da/attachment.html>
More information about the asterisk-code-review
mailing list