summaryrefslogtreecommitdiff
path: root/main/app.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-08-22 18:52:41 +0000
committerMark Michelson <mmichelson@digium.com>2013-08-22 18:52:41 +0000
commit00baddb9065b528c6d7d503e754a915da1ac10d1 (patch)
treeefc9f254012e996542b6abec7afdac7a7964d990 /main/app.c
parent8049bf94f70edd405b59b4a2ed5aa8119fd9d62b (diff)
Massively clean up app_queue.
This essentially makes app_queue usable again. From reviewboard: * Reporting of transfers and call completion is done by creating stasis subscriptions and listening for specific events in order to determine when the call is finished (either via a transfer or hangup). * Dial end messages have been added where they were previously missing. * Queue stats are properly being updated again once calls have finished. * AgentComplete stasis messages and AMI events are now occurring again. * Mixmonitor starting has been factored into its own function and uses the Mixmonitor API now instead of using ast_pbx_run() In addition to the changes in app_queue, there are several supplementary changes as well: * Queue logging now differentiates between attended and blind transfers. A note about this is in the CHANGES file. * Local channel optimization events now report more information. This includes which of the two local channels involved is the destination of the optimization, the channel that is replacing the destination local channel, and an identifier so that begin and end events can be matched to each other. The end events are now sent whether the optimization was successful or not and includes an indicator of whether the optimization was successful. * Changes were made to features and bridging_basic so that additional flags may be set on a bridge. This is necessary because the queue requires that its bridge only allows move-swap local channel optimizations into the bridge. (closes issue ASTERISK-21517) Reported by Matt Jordan (closes issue ASTERISK-21943) Reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2694 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c
index ee2bbf467..9410f9813 100644
--- a/main/app.c
+++ b/main/app.c
@@ -85,12 +85,15 @@ struct zombie {
static AST_LIST_HEAD_STATIC(zombies, zombie);
/*
- * @{ \brief Define \ref stasis topic objects for MWI
+ * @{ \brief Define \ref stasis topic objects
*/
static struct stasis_topic *mwi_topic_all;
static struct stasis_cache *mwi_state_cache;
static struct stasis_caching_topic *mwi_topic_cached;
static struct stasis_topic_pool *mwi_topic_pool;
+
+static struct stasis_topic *queue_topic_all;
+static struct stasis_topic_pool *queue_topic_pool;
/* @} */
/*
@@ -2978,8 +2981,22 @@ struct stasis_message *ast_mwi_blob_create(struct ast_mwi_state *mwi_state,
return msg;
}
+struct stasis_topic *ast_queue_topic_all(void)
+{
+ return queue_topic_all;
+}
+
+struct stasis_topic *ast_queue_topic(const char *queuename)
+{
+ return stasis_topic_pool_get_topic(queue_topic_pool, queuename);
+}
+
static void app_cleanup(void)
{
+ ao2_cleanup(queue_topic_pool);
+ queue_topic_pool = NULL;
+ ao2_cleanup(queue_topic_all);
+ queue_topic_all = NULL;
ao2_cleanup(mwi_topic_pool);
mwi_topic_pool = NULL;
ao2_cleanup(mwi_topic_all);
@@ -3015,7 +3032,14 @@ int app_init(void)
if (!mwi_topic_pool) {
return -1;
}
-
+ queue_topic_all = stasis_topic_create("stasis_queue_topic");
+ if (!queue_topic_all) {
+ return -1;
+ }
+ queue_topic_pool = stasis_topic_pool_create(queue_topic_all);
+ if (!queue_topic_pool) {
+ return -1;
+ }
return 0;
}