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
This commit is contained in:
Mark Michelson
2013-08-22 18:52:41 +00:00
parent 8049bf94f7
commit 00baddb906
11 changed files with 1046 additions and 348 deletions

View File

@@ -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);
};
/*!