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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Oct 21 13:20:33 MST 2006


Author: anthonyl
Date: Sat Oct 21 15:20:32 2006
New Revision: 45835

URL: http://svn.digium.com/view/asterisk?rev=45835&view=rev
Log:
neo-6190 working but still needs some fixes

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=45835&r1=45834&r2=45835&view=diff
==============================================================================
--- team/anthonyl/patch-branch/apps/app_queue.c (original)
+++ team/anthonyl/patch-branch/apps/app_queue.c Sat Oct 21 15:20:32 2006
@@ -347,7 +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;
+	int announceagentnum;
 	char context[AST_MAX_CONTEXT];      /*!< Exit context */
 	unsigned int monjoin:1;
 	unsigned int dead:1;
@@ -397,6 +397,9 @@
 	int rrpos;                          /*!< Round Robin - position */
 	int memberdelay;                    /*!< Seconds to delay connecting member to caller */
 	int autofill;                       /*!< Ignore the head call status and ring an available agent */
+  
+	char sound_announceagentnum1[80]; /*!< Sound file: before announcing agentnum, default to "announceagentnum1" */
+	char sound_announceagentnum2[80]; /*!< Sound file: after announcing agentnum, default to "announceagentnum2" */
 	
 	struct member *members;             /*!< Head of the list of members */
 	struct queue_ent *head;             /*!< Head of the list of callers */
@@ -1093,7 +1096,9 @@
 	while ((interface = ast_category_browse(member_config, interface))) {
 		rt_handle_member_record(q, interface,
 			S_OR(ast_variable_retrieve(member_config, interface, "membername"), interface),
-			ast_variable_retrieve(member_config, interface, "penalty"));
+			ast_variable_retrieve(member_config, interface, "penalty"),
+			ast_variable_retrieve(member_config,interface,"agentnum"));
+	      
 	}
 
 	/* Delete all realtime members that have been deleted in DB. */
@@ -2457,7 +2462,7 @@
                     ast_log(LOG_WARNING, "Agentnum announcement file '%s' is unavailable, continuing anyway...\n", 
                             qe->parent->sound_announceagentnum1);
                 // restart moh
-                ast_moh_start(qe->chan, qe->moh);
+                ast_moh_start(qe->chan, qe->moh, NULL);
             }
 			res2 |= ast_autoservice_stop(peer);
 			if (qe->chan->_softhangup) {
@@ -2957,8 +2962,8 @@
 	char *membername;
 	char *penalty_tok;
 	int penalty = 0;
-    char *agentnum_tok;
-    int agentnum = 0;
+	char *agentnum_tok;
+	int agentnum = 0;
 	char *paused_tok;
 	int paused = 0;
 	struct ast_db_entry *db_tree;
@@ -3037,7 +3042,7 @@
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Reload Members: Queue: %s  Member: %s  Name: %s  Penalty: %d  Paused: %d\n", queue_name, interface, membername, penalty, paused);
 			
-			if (add_to_queue(queue_name, interface, membername, penalty, paused, 0) == RES_OUTOFMEMORY) {
+			if (add_to_queue(queue_name, interface, membername, penalty, paused, 0,agentnum) == RES_OUTOFMEMORY) {
 				ast_log(LOG_ERROR, "Out of Memory when reloading persistent queue member\n");
 				break;
 			}
@@ -3163,6 +3168,9 @@
 	struct ast_module_user *lu;
 	char *parse, *temppos = NULL;
 	int priority_jump = 0;
+	int agentnum = 0;
+	char *agentnum_str = 0;
+	
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(queuename);
 		AST_APP_ARG(interface);
@@ -3232,11 +3240,11 @@
 		AST_APP_ARG(penalty);
 		AST_APP_ARG(options);
 		AST_APP_ARG(membername);
-	);
+		);
 	int penalty = 0;
-    int agentnum = 0;
-    char *agentnum_str = 0;
-
+	int agentnum = 0;
+	char *agentnum_str = 0;
+	
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "AddQueueMember requires an argument (queuename[|[interface]|[penalty][|options][|membername]])\n");
 		return -1;
@@ -3271,7 +3279,7 @@
 		args.membername = args.interface;
 
 
-	switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members)) {
+	switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members,agentnum)) {
 	case RES_OKAY:
 		ast_log(LOG_NOTICE, "Added interface '%s' to queue '%s'\n", args.interface, args.queuename);
 		pbx_builtin_setvar_helper(chan, "AQMSTATUS", "ADDED");
@@ -4260,9 +4268,10 @@
 
 static int manager_add_queue_member(struct mansession *s, struct message *m)
 {
-	char *queuename, *interface, *penalty_s, *paused_s, *membername;
+	char *queuename, *interface, *penalty_s, *paused_s, *agentnum_s, *membername;
 	int paused, penalty = 0;
-
+	int agentnum;
+	
 	queuename = astman_get_header(m, "Queue");
 	interface = astman_get_header(m, "Interface");
 	penalty_s = astman_get_header(m, "Penalty");
@@ -4292,7 +4301,7 @@
 	if (ast_strlen_zero(membername))
 		membername = interface;
 
-	switch (add_to_queue(queuename, interface, membername, penalty, paused, queue_persistent_members)) {
+	switch (add_to_queue(queuename, interface, membername, penalty, paused, queue_persistent_members,agentnum)) {
 	case RES_OKAY:
 		astman_send_ack(s, m, "Added interface to queue");
 		break;
@@ -4367,6 +4376,7 @@
 {
 	char *queuename, *interface, *membername;
 	int penalty;
+	int agentnum = 0;
 
 	if ((argc != 6) && (argc != 8) && (argc != 10)) {
 		return RESULT_SHOWUSAGE;
@@ -4400,7 +4410,7 @@
 		membername = interface;
 	}
 
-	switch (add_to_queue(queuename, interface, membername, penalty, 0, queue_persistent_members)) {
+	switch (add_to_queue(queuename, interface, membername, penalty, 0, queue_persistent_members, agentnum)) {
 	case RES_OKAY:
 		ast_cli(fd, "Added interface '%s' to queue '%s'\n", interface, queuename);
 		return RESULT_SUCCESS;



More information about the asterisk-commits mailing list