summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-09-20 18:44:26 +0000
committerMatthew Jordan <mjordan@digium.com>2012-09-20 18:44:26 +0000
commitca0e96ae199ce5dd38887ee40114db81ab73a534 (patch)
tree2e5243c8e8956ab5f910c4ce065d157abe4d9691
parente8380afc8a147ee299c3881423b2e0b27c4cfc0d (diff)
Add queue monitoring hints
This patch adds support for hints on a queue. Hints can be added using the nomenclature 'Queue:name', where name is the name of the queue being monitored. This nifty feature was done by Alec Davis. Review: https://reviewboard.asterisk.org/r/1619 Reported by: Alec Davis Tested by: alecdavis patches: review1619.diff2 by alecdavis (license 585) ........ Merged revisions 373235 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--CHANGES1
-rw-r--r--apps/app_queue.c7
-rw-r--r--configs/extensions.conf.sample8
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 78aaae056..da591e78a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -173,6 +173,7 @@ Queue
be logged in the agent field for ADDMEMBER and REMOVEMEMBER queue events if a
state_interface has been set.
+ * Add queue monitoring hints. exten => 8501,hint,Queue:markq.
SayUnixTime
------------------
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 69938e4f3..3c00d7692 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2868,6 +2868,10 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
ast_copy_string(qe->announce, q->announce, sizeof(qe->announce));
ast_copy_string(qe->context, q->context, sizeof(qe->context));
q->count++;
+ if (q->count == 1) {
+ ast_devstate_changed(AST_DEVICE_RINGING, "Queue:%s", q->name);
+ }
+
res = 0;
/*** DOCUMENTATION
<managerEventInstance>
@@ -3172,6 +3176,9 @@ static void leave_queue(struct queue_ent *qe)
if (current == qe) {
char posstr[20];
q->count--;
+ if (!q->count) {
+ ast_devstate_changed(AST_DEVICE_NOT_INUSE, "Queue:%s", q->name);
+ }
/* Take us out of the queue */
/*** DOCUMENTATION
diff --git a/configs/extensions.conf.sample b/configs/extensions.conf.sample
index 683739a6b..df91223f0 100644
--- a/configs/extensions.conf.sample
+++ b/configs/extensions.conf.sample
@@ -708,12 +708,16 @@ include => demo
;exten => 6600,hint,park:701@parkedcalls
;exten => 6600,1,noop
;
-
;To subscribe to the availability of a free member in the 'markq' queue.
;Note: '_avail' is added to the QueueName
;exten => 8501,hint,Queue:markq_avail
;exten => 8501,1,Queue(markq)
-
+;
+; You can also monitor the status of a queue by providing a hint for a
+; particular queue name.
+;exten => 8502,hint,Queue:markq
+;exten => 8502,1,Queue(markq)
+;
; Some other handy things are an extension for checking voicemail via
; voicemailmain
;