summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2006-11-17 20:46:36 +0000
committerJason Parker <jparker@digium.com>2006-11-17 20:46:36 +0000
commita1a37dddfe578742a4b94293c6c3cf09bde26dc4 (patch)
tree139c99149fb215ff2e37f783151fb9d118e4e356 /apps/app_queue.c
parent03ee5533430587d0595ba0eb71741d4f1a6a9aaf (diff)
Add ability to add custom queue log via manager interface.
Issue 7806, patch by alexrch, with slight modifications by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index bdc5eefa4..75892cdea 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4461,6 +4461,27 @@ static int manager_pause_queue_member(struct mansession *s, struct message *m)
return 0;
}
+static int manager_queue_log_custom(struct mansession *s, struct message *m)
+{
+ char *queuename, *event, *message, *interface, *uniqueid;
+
+ queuename = astman_get_header(m, "Queue");
+ uniqueid = astman_get_header(m, "UniqueId");
+ interface = astman_get_header(m, "Interface");
+ event = astman_get_header(m, "Event");
+ message = astman_get_header(m, "Message");
+
+ if (ast_strlen_zero(queuename) || ast_strlen_zero(event)) {
+ astman_send_error(s, m, "Need 'Queue' and 'Event' parameters.");
+ return 0;
+ }
+
+ ast_queue_log(queuename, S_OR(uniqueid, "NONE"), interface, event, "%s", message);
+ astman_send_ack(s, m, "Event added successfully");
+
+ return 0;
+}
+
static int handle_queue_add_member(int fd, int argc, char *argv[])
{
char *queuename, *interface, *membername;
@@ -4648,6 +4669,7 @@ static int unload_module(void)
res |= ast_manager_unregister("QueueAdd");
res |= ast_manager_unregister("QueueRemove");
res |= ast_manager_unregister("QueuePause");
+ res |= ast_manager_unregister("QueueLog");
res |= ast_unregister_application(app_aqm);
res |= ast_unregister_application(app_rqm);
res |= ast_unregister_application(app_pqm);
@@ -4686,6 +4708,7 @@ static int load_module(void)
res |= ast_manager_register("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member, "Add interface to queue.");
res |= ast_manager_register("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member, "Remove interface from queue.");
res |= ast_manager_register("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member, "Makes a queue member temporarily unavailable");
+ res |= ast_manager_register("QueueLog", EVENT_FLAG_AGENT, manager_queue_log_custom, "Adds custom entry in queue_log");
res |= ast_custom_function_register(&queuevar_function);
res |= ast_custom_function_register(&queuemembercount_function);
res |= ast_custom_function_register(&queuememberlist_function);