summaryrefslogtreecommitdiff
path: root/include/asterisk/stasis_app_snoop.h
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-11-23 12:40:46 +0000
committerJoshua Colp <jcolp@digium.com>2013-11-23 12:40:46 +0000
commiteda712686268daaaf02754fbb0903cf4f973da87 (patch)
tree4c5b2693ddb1c30c24abdab8f1563997cc89023c /include/asterisk/stasis_app_snoop.h
parenta368df42d47d24a981097ac4c4f71b904be55346 (diff)
ari: Add Snoop operation for spying/whispering on channels.
The Snoop operation can be invoked on a channel to spy or whisper on it. It returns a channel that any channel operations can then be invoked on (such as record to do monitoring). (closes issue ASTERISK-22780) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3003/ ........ Merged revisions 403117 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/stasis_app_snoop.h')
-rw-r--r--include/asterisk/stasis_app_snoop.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/asterisk/stasis_app_snoop.h b/include/asterisk/stasis_app_snoop.h
new file mode 100644
index 000000000..a9c998f03
--- /dev/null
+++ b/include/asterisk/stasis_app_snoop.h
@@ -0,0 +1,60 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * Joshua Colp <jcolp@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.
+ */
+
+#ifndef _ASTERISK_STASIS_APP_SNOOP_H
+#define _ASTERISK_STASIS_APP_SNOOP_H
+
+/*! \file
+ *
+ * \brief Stasis Application Snoop API. See \ref res_stasis "Stasis
+ * Application API" for detailed documentation.
+ *
+ * \author Joshua Colp <jcolp@digium.com>
+ * \since 12
+ */
+
+#include "asterisk/stasis_app.h"
+
+/*! \brief Directions for audio stream flow */
+enum stasis_app_snoop_direction {
+ /*! \brief No direction */
+ STASIS_SNOOP_DIRECTION_NONE = 0,
+ /*! \brief Audio stream out to the channel */
+ STASIS_SNOOP_DIRECTION_OUT,
+ /*! \brief Audio stream in from the channel */
+ STASIS_SNOOP_DIRECTION_IN,
+ /*! \brief Audio stream to AND from the channel */
+ STASIS_SNOOP_DIRECTION_BOTH,
+};
+
+/*!
+ * \brief Create a snoop on the provided channel.
+ *
+ * \param chan Channel to snoop on.
+ * \param spy Direction of media that should be spied on.
+ * \param whisper Direction of media that should be whispered into.
+ * \param app Stasis application to execute on the snoop channel.
+ * \param app_args Stasis application arguments.
+ * \return Snoop channel. ast_channel_unref() when done.
+ * \return \c NULL if snoop channel couldn't be created.
+ */
+struct ast_channel *stasis_app_control_snoop(struct ast_channel *chan,
+ enum stasis_app_snoop_direction spy, enum stasis_app_snoop_direction whisper,
+ const char *app, const char *app_args);
+
+#endif /* _ASTERISK_STASIS_APP_SNOOP_H */