[asterisk-commits] anthonyl: branch anthonyl/patch-branch r45834 - /team/anthonyl/patch-branch/a...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Oct 21 12:38:04 MST 2006


Author: anthonyl
Date: Sat Oct 21 14:38:03 2006
New Revision: 45834

URL: http://svn.digium.com/view/asterisk?rev=45834&view=rev
Log:
backup time. but close to working

Modified:
    team/anthonyl/patch-branch/apps/app_queue.c

Modified: team/anthonyl/patch-branch/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/patch-branch/apps/app_queue.c?rev=45834&r1=45833&r2=45834&view=diff
==============================================================================
--- team/anthonyl/patch-branch/apps/app_queue.c (original)
+++ team/anthonyl/patch-branch/apps/app_queue.c Sat Oct 21 14:38:03 2006
@@ -316,6 +316,7 @@
 struct member {
 	char interface[80];                 /*!< Technology/Location */
 	char membername[80];                /*!< Member name to use in queue logs */
+	int agentnum;
 	int penalty;                        /*!< Are we a last resort? */
 	int calls;                          /*!< Number of calls serviced by this member */
 	int dynamic;                        /*!< Are we dynamically added? */
@@ -346,6 +347,7 @@
 	char name[80];                      /*!< Name */
 	char moh[80];                       /*!< Music On Hold class to be used */
 	char announce[80];                  /*!< Announcement to play when call is answered */
+	int accounceagentnum;
 	char context[AST_MAX_CONTEXT];      /*!< Exit context */
 	unsigned int monjoin:1;
 	unsigned int dead:1;
@@ -605,7 +607,7 @@
 	return 0;
 }
 
-static struct member *create_queue_member(char *interface, const char *membername, int penalty, int paused)
+static struct member *create_queue_member(char *interface, const char *membername, int penalty, int paused, int agentnum)
 {
 	struct member *cur;
 	
@@ -931,11 +933,20 @@
 	}
 }
 
-static void rt_handle_member_record(struct call_queue *q, char *interface, const char *membername, const char *penalty_str)
+static void rt_handle_member_record(struct call_queue *q, char *interface, const char *membername, const char *penalty_str, const char * agentnum_str)
 {
 	struct member *m, *prev_m;
 	int penalty = 0;
-
+	int agentnum = 0;
+	
+	if (!agentnum_str) 
+		ast_log(LOG_NOTICE,"agentnum_str missing!\n");
+	else {
+		agentnum = atoi(agentnum_str);
+		if (agentnum < 0)
+			agentnum = 0;
+	}
+	
 	if (penalty_str) {
 		penalty = atoi(penalty_str);
 		if (penalty < 0)
@@ -949,7 +960,7 @@
 
 	/* Create a new one if not found, else update penalty */
 	if (!m) {
-		if ((m = create_queue_member(interface, membername, penalty, 0))) {
+		if ((m = create_queue_member(interface, membername, penalty, 0,agentnum))) {
 			m->dead = 0;
 			add_to_interfaces(interface);
 			if (prev_m) {
@@ -2841,7 +2852,7 @@
 }
 
 
-static int add_to_queue(char *queuename, char *interface, char *membername, int penalty, int paused, int dump)
+static int add_to_queue(char *queuename, char *interface, char *membername, int penalty, int paused, int dump, int agentnum)
 {
 	struct call_queue *q;
 	struct member *new_member;
@@ -2857,7 +2868,7 @@
 	ast_mutex_lock(&q->lock);
 	if (interface_exists(q, interface) == NULL) {
 		add_to_interfaces(interface);
-		if ((new_member = create_queue_member(interface, membername, penalty, paused))) {
+		if ((new_member = create_queue_member(interface, membername, penalty, paused, agentnum))) {
 			new_member->dynamic = 1;
 			new_member->next = q->members;
 			q->members = new_member;
@@ -2867,13 +2878,14 @@
 				"MemberName: %s\r\n"
 				"Membership: %s\r\n"
 				"Penalty: %d\r\n"
+				"AgentNumber: %d\r\n"
 				"CallsTaken: %d\r\n"
 				"LastCall: %d\r\n"
 				"Status: %d\r\n"
 				"Paused: %d\r\n",
 				q->name, new_member->interface, new_member->membername,
 				new_member->dynamic ? "dynamic" : "static",
-				new_member->penalty, new_member->calls, (int) new_member->lastcall,
+				new_member->penalty,new_member->agentnum, new_member->calls, (int) new_member->lastcall,
 				new_member->status, new_member->paused);
 			
 			if (dump)
@@ -3761,6 +3773,8 @@
 	char *interface;
 	char *membername;
 	int penalty;
+	int agentnum = 0;
+	
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(interface);
 		AST_APP_ARG(penalty);
@@ -3852,7 +3866,7 @@
 							}
 						}
 
-						newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0);
+						newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, agentnum);
 
 						if (cur) {
 							/* Delete it now */



More information about the asterisk-commits mailing list