[asterisk-commits] mjordan: trunk r373239 - in /trunk: ./ apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 20 13:44:30 CDT 2012


Author: mjordan
Date: Thu Sep 20 13:44:26 2012
New Revision: 373239

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373239
Log:
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

Modified:
    trunk/   (props changed)
    trunk/CHANGES
    trunk/apps/app_queue.c
    trunk/configs/extensions.conf.sample

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=373239&r1=373238&r2=373239
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Thu Sep 20 13:44:26 2012
@@ -173,6 +173,7 @@
    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
 ------------------

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=373239&r1=373238&r2=373239
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Sep 20 13:44:26 2012
@@ -2868,6 +2868,10 @@
 		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 @@
 		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

Modified: trunk/configs/extensions.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/extensions.conf.sample?view=diff&rev=373239&r1=373238&r2=373239
==============================================================================
--- trunk/configs/extensions.conf.sample (original)
+++ trunk/configs/extensions.conf.sample Thu Sep 20 13:44:26 2012
@@ -708,12 +708,16 @@
 ;exten => 6600,hint,park:701 at 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
 ;




More information about the asterisk-commits mailing list