summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-07-01 16:01:24 +0000
committerJonathan Rose <jrose@digium.com>2013-07-01 16:01:24 +0000
commitf306dbd8412778ef31df791b658dc38e15629ae3 (patch)
treef8203232ba890acc8cfdd5bd0ce8004c9801433b /include/asterisk
parent909ee4bfb9180a87e02504acb47f27b47cb5adea (diff)
bridge_features: Support One touch Monitor/MixMonitor
In addition to porting those features, they now enjoy greater feature parity with one another. Specifically, AutoMixMon now has a start and stop message that can be specified with TOUCH_MIXMONITOR_MESSAGE_START and TOUCH_MIXMONITOR_MESSAGE_STOP. (closes issue ASTERISK-21553) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2620/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/channel.h11
-rw-r--r--include/asterisk/features_config.h2
-rw-r--r--include/asterisk/mixmonitor.h105
3 files changed, 118 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 1b36c14ae..fae43d423 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -2596,6 +2596,17 @@ struct ast_group_info {
*/
#define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); })
+/*!
+ * \brief Cleanup a channel reference
+ *
+ * \param c the channel (NULL tolerant)
+ *
+ * \retval NULL always
+ *
+ * \since 12.0.0
+ */
+#define ast_channel_cleanup(c) ({ ao2_cleanup(c); (struct ast_channel *) (NULL); })
+
/*! Channel Iterating @{ */
/*!
diff --git a/include/asterisk/features_config.h b/include/asterisk/features_config.h
index a80fa7968..7be019cd2 100644
--- a/include/asterisk/features_config.h
+++ b/include/asterisk/features_config.h
@@ -30,6 +30,8 @@ struct ast_features_general_config {
AST_DECLARE_STRING_FIELDS(
/*! Sound played when automon or automixmon features are used */
AST_STRING_FIELD(courtesytone);
+ /*! Sound played when automon or automixmon features fail when used */
+ AST_STRING_FIELD(recordingfailsound);
);
/*! Milliseconds allowed between digit presses when entering feature code */
unsigned int featuredigittimeout;
diff --git a/include/asterisk/mixmonitor.h b/include/asterisk/mixmonitor.h
new file mode 100644
index 000000000..892cd2a78
--- /dev/null
+++ b/include/asterisk/mixmonitor.h
@@ -0,0 +1,105 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * Jonathan Rose <jrose@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief loadable MixMonitor functionality
+ *
+ * \author Jonathan Rose <jrose@digium.com>
+ */
+
+/*!
+ * \brief Start a mixmonitor on a channel.
+ * \since 12.0.0
+ *
+ * \param chan Which channel to put the MixMonitor on
+ * \param filename What the name of the file should be
+ * \param options What options should be used for the mixmonitor
+ *
+ * \retval 0 on success
+ * \retval non-zero on failure
+ */
+typedef int (*ast_mixmonitor_start_fn)(struct ast_channel *chan, const char *filename, const char *options);
+
+/*!
+ * \brief Stop a mixmonitor on a channel.
+ * \since 12.0.0
+ *
+ * \param chan Which channel to stop a MixMonitor on
+ * \param mixmon_id Stop the MixMonitor with this mixmonid if it is on the channel (may be NULL)
+ *
+ * \retval 0 on success
+ * \retval non-zero on failure
+ */
+typedef int (*ast_mixmonitor_stop_fn)(struct ast_channel *chan, const char *mixmon_id);
+
+/*!
+ * \brief MixMonitor virtual methods table definition
+ * \since 12.0.0
+ */
+struct ast_mixmonitor_methods {
+ ast_mixmonitor_start_fn start;
+ ast_mixmonitor_stop_fn stop;
+};
+
+/*!
+ * \brief Setup MixMonitor virtual methods table. Use this to provide the MixMonitor functionality from a loadable module.
+ * \since 12.0.0
+ *
+ * \param vmethod_table pointer to vmethod table providing mixmonitor functions
+ *
+ * \retval 0 if successful
+ * \retval non-zero on failure
+ */
+int ast_set_mixmonitor_methods(struct ast_mixmonitor_methods *vmethod_table);
+
+/*!
+ * \brief Clear the MixMonitor virtual methods table. Use this to cleanup function pointers provided by a module that set.
+ * \since 12.0.0
+ *
+ * \retval 0 if successful
+ * \retval non-zero on failure (occurs when methods aren't loaded)
+ */
+int ast_clear_mixmonitor_methods(void);
+
+/*!
+ * \brief Start a mixmonitor on a channel with the given parameters
+ * \since 12.0.0
+ *
+ * \param chan Which channel to apply the MixMonitor to
+ * \param filename filename to use for the recording
+ * \param options Optional arguments to be interpreted by the MixMonitor start function
+ *
+ * \retval 0 if successful
+ * \retval non-zero on failure
+ *
+ * \note This function will always fail is nothing has set the mixmonitor methods
+ */
+int ast_start_mixmonitor(struct ast_channel *chan, const char *filename, const char *options);
+
+/*!
+ * \brief Stop a mixmonitor on a channel with the given parameters
+ * \since 12.0.0
+ *
+ * \param chan Which channel to stop a MixMonitor on (may be NULL if mixmon_id is provided)
+ * \param mixmon_id Which mixmon_id should be stopped (may be NULL if chan is provided)
+ *
+ * \retval 0 if successful
+ * \retval non-zero on failure
+ */
+int ast_stop_mixmonitor(struct ast_channel *chan, const char *mixmon_id);