[Asterisk-cvs] asterisk/apps app_queue.c,1.55,1.56

citats at lists.digium.com citats at lists.digium.com
Mon Apr 26 02:51:21 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv26884/apps

Modified Files:
	app_queue.c 
Log Message:
Make RemoveQueueMember and AddQueueMember jump to priority + 101 (bug 1022)


Index: app_queue.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_queue.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- app_queue.c	10 Apr 2004 21:10:22 -0000	1.55
+++ app_queue.c	26 Apr 2004 06:57:15 -0000	1.56
@@ -18,6 +18,7 @@
  * Patch Version 1.07 2003-12-24 01
  *
  * Added servicelevel statistic by Michiel Betel <michiel at betel.nl>
+ * Added Priority jumping code for adding and removing queue members by Jonathan Stanton <asterisk at doilooklikeicare.com>
  *
  * Fixed ot work with CVS as of 2004-02-25 and released as 1.07a
  * by Matthew Enger <m.enger at xi.com.au>
@@ -106,7 +107,9 @@
 static char *app_aqm_synopsis = "Dynamically adds queue members" ;
 static char *app_aqm_descrip =
 "   AddQueueMember(queuename[|interface]):\n"
-"Dynamically adds interface to an existing queue\n"
+"Dynamically adds interface to an existing queue.\n"
+"If the interface is already in the queue and there exists an n+101 priority\n"
+"then it will then jump to this priority.  Otherwise it will return an error\n"
 "Returns -1 if there is an error.\n"
 "Example: AddQueueMember(techsupport|SIP/3000)\n"
 "";
@@ -116,6 +119,8 @@
 static char *app_rqm_descrip =
 "   RemoveQueueMember(queuename[|interface]):\n"
 "Dynamically removes interface to an existing queue\n"
+"If the interface is NOT in the queue and there exists an n+101 priority\n"
+"then it will then jump to this priority.  Otherwise it will return an error\n"
 "Returns -1 if there is an error.\n"
 "Example: RemoveQueueMember(techsupport|SIP/3000)\n"
 "";
@@ -1179,8 +1184,15 @@
 					res = 0 ;
 				}
 				else
+				{
 					ast_log(LOG_WARNING, "Unable to remove interface '%s' from queue '%s': "
 						"Not there\n", interface, queuename);
+	                                if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid))
+						{
+						chan->priority += 100;
+						res = 0 ;
+						}
+				}
 			}
 
 			ast_mutex_unlock(&q->lock);
@@ -1259,8 +1271,15 @@
 					res = 0 ;
 				}
 				else
+				{
 					ast_log(LOG_WARNING, "Unable to add interface '%s' to queue '%s': "
 						"Already there\n", interface, queuename);
+			                if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid))
+                                        {
+                                                chan->priority += 100;
+                                                res = 0 ;
+                                        }
+				}
 			}
 
 			ast_mutex_unlock(&q->lock);




More information about the svn-commits mailing list