OneTouchRecord: Make so Monitor/MixMonitor can be toggled/started/stopped.

The OneTouchRecord feature has historically been a toggle.  This patch
adds the ability to make the OneTouchRecord hook optionally start/stop
recording only.  If OneTouchRecord is already doing what is requested then
only the invoker hears the courtesy tone and/or start/stop recording
message.

The new feature is written so we could easily add explicit start/stop
recording DTMF hooks for Monitor and MixMonitor.

The majority of the changes in bridge_builtin_features.c is a refactoring
of the OneTouchRecord code (Monitor and MixMonitor versions) so it is easy
to direct the toggle/start/stop functionality.

Review: https://reviewboard.asterisk.org/r/2655/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-07-03 22:36:38 +00:00
parent ad5dc3c159
commit 0227e00eb3
2 changed files with 306 additions and 144 deletions

View File

@@ -267,6 +267,25 @@ struct ast_bridge_features_attended_transfer {
char complete[MAXIMUM_DTMF_FEATURE_STRING];
};
enum ast_bridge_features_monitor {
/*! Toggle start/stop of Monitor/MixMonitor. */
AUTO_MONITOR_TOGGLE,
/*! Start Monitor/MixMonitor if not already started. */
AUTO_MONITOR_START,
/*! Stop Monitor/MixMonitor if not already stopped. */
AUTO_MONITOR_STOP,
};
struct ast_bridge_features_automonitor {
/*! Start/Stop behavior. */
enum ast_bridge_features_monitor start_stop;
};
struct ast_bridge_features_automixmonitor {
/*! Start/Stop behavior. */
enum ast_bridge_features_monitor start_stop;
};
/*!
* \brief Structure that contains configuration information for the limits feature
*/
@@ -329,6 +348,26 @@ int ast_bridge_features_register(enum ast_bridge_builtin_feature feature, ast_br
*/
int ast_bridge_features_unregister(enum ast_bridge_builtin_feature feature);
/*!
* \brief Invoke a built in feature hook now.
*
* \param feature The feature to invoke
*
* \note This API call is only meant to be used by bridge
* subclasses and hook callbacks to request a builtin feature
* hook to be executed.
*
* \retval 0 on success
* \retval -1 on failure
*
* Example usage:
*
* \code
* ast_bridge_features_do(AST_BRIDGE_BUILTIN_ATTENDED_TRANSFER, bridge, bridge_channel, hook_pvt);
* \endcode
*/
int ast_bridge_features_do(enum ast_bridge_builtin_feature feature, struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt);
/*!
* \brief Attach interval hooks to a bridge features structure
*