summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/asterisk/app.h16
-rw-r--r--include/asterisk/bridge_basic.h12
-rw-r--r--include/asterisk/core_unreal.h17
-rw-r--r--include/asterisk/features.h14
4 files changed, 57 insertions, 2 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 06b903e2f..c30290f6e 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -1284,6 +1284,22 @@ struct stasis_message_type *ast_mwi_state_type(void);
*/
struct stasis_message_type *ast_mwi_vm_app_type(void);
+/*!
+ * \brief Get the \ref stasis topic for queue messages
+ * \retval The topic structure for queue messages
+ * \retval NULL if it has not been allocated
+ * \since 12
+ */
+struct stasis_topic *ast_queue_topic_all(void);
+
+/*!
+ * \brief Get the \ref stasis topic for queue messages for a particular queue name
+ * \param queuename The name for which to get the topic
+ * \retval The topic structure for queue messages for a given name
+ * \retval NULL if it failed to be found or allocated
+ * \since 12
+ */
+struct stasis_topic *ast_queue_topic(const char *queuename);
/*! @} */
/*!
diff --git a/include/asterisk/bridge_basic.h b/include/asterisk/bridge_basic.h
index 560e94d5f..483bf230e 100644
--- a/include/asterisk/bridge_basic.h
+++ b/include/asterisk/bridge_basic.h
@@ -33,6 +33,7 @@
extern "C" {
#endif
+#define AST_TRANSFERER_ROLE_NAME "transferer"
/* ------------------------------------------------------------------- */
/*!
@@ -126,6 +127,17 @@ extern struct ast_bridge_methods ast_bridge_basic_v_table;
*/
struct ast_bridge *ast_bridge_basic_new(void);
+/*!
+ * \brief Set feature flags on a basic bridge
+ *
+ * Using this function instead of setting flags directly will
+ * ensure that after operations such as an attended transfer,
+ * the bridge will maintain the flags that were set on it.
+ *
+ * \params Flags to set on the bridge. These are added to the flags already set.
+ */
+void ast_bridge_basic_set_flags(struct ast_bridge *bridge, unsigned int flags);
+
/*! Initialize the basic bridge class for use by the system. */
void ast_bridging_init_basic(void);
diff --git a/include/asterisk/core_unreal.h b/include/asterisk/core_unreal.h
index 9a8d2e1f5..cd8a2cdf7 100644
--- a/include/asterisk/core_unreal.h
+++ b/include/asterisk/core_unreal.h
@@ -46,6 +46,11 @@ struct ast_callid;
struct ast_unreal_pvt;
+enum ast_unreal_channel_indicator {
+ AST_UNREAL_OWNER,
+ AST_UNREAL_CHAN,
+};
+
/*!
* \brief Callbacks that can be provided by concrete implementations of the unreal
* channel driver that will be called when events occur in the unreal layer
@@ -55,8 +60,14 @@ struct ast_unreal_pvt_callbacks {
* \brief Called when an optimization attempt has started
* \note p is locked when this callback is called
* \param p The \ref ast_unreal_pvt object
+ * \param source The channel that is optimizing into an unreal_pvt channel's bridge.
+ * If NULL, the optimization is being accomplished via a bridge merge.
+ * \param dest Indicator of which channel's bridge in the unreal_pvt will survive the
+ * optimization
+ * \param id Unique identifier for this optimization operation.
*/
- void (* const optimization_started)(struct ast_unreal_pvt *p);
+ void (* const optimization_started)(struct ast_unreal_pvt *p, struct ast_channel *source,
+ enum ast_unreal_channel_indicator dest, unsigned int id);
/*!
* \brief Called when an optimization attempt completed successfully
@@ -64,8 +75,10 @@ struct ast_unreal_pvt_callbacks {
* \param p The \ref ast_unreal_pvt object
* \param success Non-zero if the optimization succeeded, zero if the optimization
* met with fatal and permanent error
+ * \param id Unique identifier for this optimization. Same as the one from the optimization_started
+ * call
*/
- void (* const optimization_finished)(struct ast_unreal_pvt *p);
+ void (* const optimization_finished)(struct ast_unreal_pvt *p, int success, unsigned int id);
};
/*!
diff --git a/include/asterisk/features.h b/include/asterisk/features.h
index 9430bc4cb..af9b77749 100644
--- a/include/asterisk/features.h
+++ b/include/asterisk/features.h
@@ -43,6 +43,20 @@ enum {
int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
/*!
+ * \brief Bridge a call, and add additional flags to the bridge
+ *
+ * This does the same thing as \ref ast_bridge_call, except that once the bridge
+ * is created, the provided flags are set on the bridge. The provided flags are
+ * added to the bridge's flags; they will not clear any flags already set.
+ *
+ * \param chan The calling channel
+ * \param peer The called channel
+ * \param config Bridge configuration for the channels
+ * \param flags Additional flags to set on the created bridge
+ */
+int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags);
+
+/*!
* \brief Add an arbitrary channel to a bridge
* \since 12.0.0
*