Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 34307) +++ apps/app_queue.c (working copy) @@ -227,6 +227,13 @@ " UNPAUSED | NOTFOUND\n" "Example: UnpauseQueueMember(|SIP/3000)\n"; +static char *app_ql = "QueueLog" ; +static char *app_ql_synopsis = "Writes to the queue_log" ; +static char *app_ql_descrip = +" QueueLog(queuename,uniqueid,agent,event,params):\n" +"Allows you to write your own events into the queue log\n" +"Example: QueueLog(101,${UNIQUEID},${AGENT},WENTONBREAK,600)\n"; + /*! \brief Persistent Members astdb family */ static const char *pm_family = "/Queue/PersistentMembers"; /* The maximum length of each persistent member queue database entry */ @@ -3121,6 +3128,40 @@ return res; } +static int ql_exec(struct ast_channel *chan, void *data) +{ + struct localuser *u; + char *parse; + + AST_DECLARE_APP_ARGS(args, + AST_APP_ARG(queuename); + AST_APP_ARG(uniqueid); + AST_APP_ARG(peer); + AST_APP_ARG(event); + AST_APP_ARG(params); + ); + + if (ast_strlen_zero(data)) { + ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|peer|event|more|params|...)\n"); + return -1; + } + + LOCAL_USER_ADD(u); + + if (!(parse = ast_strdupa(data))) { + ast_log(LOG_WARNING, "Memory Error!\n"); + LOCAL_USER_REMOVE(u); + return -1; + } + + AST_STANDARD_APP_ARGS(args, parse); + + ast_queue_log(args.queuename, args.uniqueid, args.peer, args.event, "%s", args.params); + + LOCAL_USER_REMOVE(u); + return 0; +} + static int queue_exec(struct ast_channel *chan, void *data) { int res=-1; @@ -4282,6 +4323,7 @@ res |= ast_register_application(app_rqm, rqm_exec, app_rqm_synopsis, app_rqm_descrip) ; res |= ast_register_application(app_pqm, pqm_exec, app_pqm_synopsis, app_pqm_descrip) ; res |= ast_register_application(app_upqm, upqm_exec, app_upqm_synopsis, app_upqm_descrip) ; + res |= ast_register_application(app_ql, ql_exec, app_ql_synopsis, app_ql_descrip) ; res |= ast_custom_function_register(&queueagentcount_function); res |= ast_custom_function_register(&queuemembercount_function); res |= ast_custom_function_register(&queuememberlist_function);