[asterisk-commits] branch bweschke/polycom_acd_functions - r8040 in /team/bweschke/polycom_acd_f...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 12 16:10:25 CST 2006


Author: bweschke
Date: Thu Jan 12 16:10:23 2006
New Revision: 8040

URL: http://svn.digium.com/view/asterisk?rev=8040&view=rev
Log:
 Added callback functions for pausing / unpausing members in queue


Added:
    team/bweschke/polycom_acd_functions/include/asterisk/queues.h
Modified:
    team/bweschke/polycom_acd_functions/channel.c

Modified: team/bweschke/polycom_acd_functions/channel.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/polycom_acd_functions/channel.c?rev=8040&r1=8039&r2=8040&view=diff
==============================================================================
--- team/bweschke/polycom_acd_functions/channel.c (original)
+++ team/bweschke/polycom_acd_functions/channel.c Thu Jan 12 16:10:23 2006
@@ -54,6 +54,7 @@
 #include "asterisk/options.h"
 #include "asterisk/channel.h"
 #include "asterisk/chanspy.h"
+#include "asterisk/queues.h"
 #include "asterisk/agents.h"
 #include "asterisk/musiconhold.h"
 #include "asterisk/logger.h"
@@ -3729,6 +3730,9 @@
 	return group;
 }
 
+static int (*ast_queuemember_callback_pause_ptr)(char *) = NULL;
+static int (*ast_queuemember_callback_unpause_ptr)(char *) = NULL;
+
 static int (*ast_agent_callback_login_ptr)(char *, char *, char *, char *, char *) = NULL;
 static void (*ast_agent_callback_logout_ptr)(char *) = NULL;
 
@@ -3746,6 +3750,18 @@
 {
 	ast_agent_callback_login_ptr = NULL;
 	ast_agent_callback_logout_ptr = NULL;
+}
+
+void ast_install_queuemember_functions(int (*pause_ptr)(char *), int (*unpause_ptr)(char *))
+{
+	ast_queuemember_callback_pause_ptr = pause_ptr;
+	ast_queuemember_callback_unpause_ptr = unpause_ptr;
+}
+
+void ast_uninstall_queuemember_functions(void)
+{
+	ast_queuemember_callback_pause_ptr = NULL;
+	ast_queuemember_callback_unpause_ptr = NULL;
 }
 
 void ast_install_music_functions(int (*start_ptr)(struct ast_channel *, char *),
@@ -3772,7 +3788,7 @@
 		return ast_agent_callback_login_ptr(agent, exten, context, wrapuptime, ackcall);
 
 	if (option_verbose > 2)
-		ast_verbose(VERBOSE_PREFIX_3 "Agent callback login requested but not callback function registered.\n");
+		ast_verbose(VERBOSE_PREFIX_3 "Agent callback login requested but no callback function registered.\n");
 	
 	return 0;
 }
@@ -3784,6 +3800,28 @@
 	if (ast_agent_callback_logout_ptr)
 		return ast_agent_callback_logout_ptr(agent);
 
+}
+
+/*! \brief Pause a queue member for later callback */
+int ast_queuemember_callback_pause(char *agent)
+{
+	if (ast_queuemember_callback_pause_ptr)
+		return ast_queuemember_callback_pause_ptr(agent);
+
+	if (option_verbose > 2)
+		ast_verbose(VERBOSE_PREFIX_3 "Queue Member pause requested but no callback function registered.\n");
+
+	return 0;
+}
+
+/*! \brief Unpause a queue member for later callback */
+int ast_queuemember_callback_unpause(char *agent)
+{
+
+	if (ast_queuemember_callback_unpause_ptr)
+		return ast_queuemember_callback_unpause_ptr(agent);
+
+	return 0;
 }
 
 /*! \brief Turn on music on hold on a given channel */

Added: team/bweschke/polycom_acd_functions/include/asterisk/queues.h
URL: http://svn.digium.com/view/asterisk/team/bweschke/polycom_acd_functions/include/asterisk/queues.h?rev=8040&view=auto
==============================================================================
--- team/bweschke/polycom_acd_functions/include/asterisk/queues.h (added)
+++ team/bweschke/polycom_acd_functions/include/asterisk/queues.h Thu Jan 12 16:10:23 2006
@@ -1,0 +1,48 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 1999 - 2006, Digium, Inc.
+ *
+ * Mark Spencer <markster at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ * \brief Queue API (For Pause/Unpause) 
+ */
+
+#ifndef _AST_QUEUE_H
+#define _AST_QUEUE_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/*! \brief Pause a Queue Member in all Queues 
+ *  \param agent
+*/
+extern int ast_queuemember_callback_pause(char *agent);
+
+/*! \brief Unpause a Queue Member in all Queues 
+ *  \param agent
+*/
+extern int ast_queuemember_callback_unpause(char *agent);
+
+extern void ast_install_queuemember_functions(int (*pause_ptr)(char *), int (*unpause_ptr)(char *));
+
+extern void ast_uninstall_queuemember_functions(void);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* _AST_QUEUE_H */



More information about the asterisk-commits mailing list