Asterisk - The Open Source Telephony Project  18.5.0
mixmonitor.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2013, Digium, Inc.
5  *
6  * Jonathan Rose <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*! \file
20  *
21  * \brief loadable MixMonitor functionality
22  *
23  * \author Jonathan Rose <[email protected]>
24  */
25 
26 #ifndef ASTERISK_MIX_MONITOR_H
27 #define ASTERISK_MIX_MONITOR_H
28 
29 /*!
30  * \brief Start a mixmonitor on a channel.
31  * \since 12.0.0
32  *
33  * \param chan Which channel to put the MixMonitor on
34  * \param filename What the name of the file should be
35  * \param options What options should be used for the mixmonitor
36  *
37  * \retval 0 on success
38  * \retval non-zero on failure
39  */
40 typedef int (*ast_mixmonitor_start_fn)(struct ast_channel *chan, const char *filename, const char *options);
41 
42 /*!
43  * \brief Stop a mixmonitor on a channel.
44  * \since 12.0.0
45  *
46  * \param chan Which channel to stop a MixMonitor on
47  * \param mixmon_id Stop the MixMonitor with this mixmonid if it is on the channel (may be NULL)
48  *
49  * \retval 0 on success
50  * \retval non-zero on failure
51  */
52 typedef int (*ast_mixmonitor_stop_fn)(struct ast_channel *chan, const char *mixmon_id);
53 
54 /*!
55  * \brief MixMonitor virtual methods table definition
56  * \since 12.0.0
57  */
61 };
62 
63 /*!
64  * \brief Setup MixMonitor virtual methods table. Use this to provide the MixMonitor functionality from a loadable module.
65  * \since 12.0.0
66  *
67  * \param vmethod_table pointer to vmethod table providing mixmonitor functions
68  *
69  * \retval 0 if successful
70  * \retval non-zero on failure
71  */
72 int ast_set_mixmonitor_methods(struct ast_mixmonitor_methods *vmethod_table);
73 
74 /*!
75  * \brief Clear the MixMonitor virtual methods table. Use this to cleanup function pointers provided by a module that set.
76  * \since 12.0.0
77  *
78  * \retval 0 if successful
79  * \retval non-zero on failure (occurs when methods aren't loaded)
80  */
82 
83 /*!
84  * \brief Start a mixmonitor on a channel with the given parameters
85  * \since 12.0.0
86  *
87  * \param chan Which channel to apply the MixMonitor to
88  * \param filename filename to use for the recording
89  * \param options Optional arguments to be interpreted by the MixMonitor start function
90  *
91  * \retval 0 if successful
92  * \retval non-zero on failure
93  *
94  * \note This function will always fail is nothing has set the mixmonitor methods
95  */
96 int ast_start_mixmonitor(struct ast_channel *chan, const char *filename, const char *options);
97 
98 /*!
99  * \brief Stop a mixmonitor on a channel with the given parameters
100  * \since 12.0.0
101  *
102  * \param chan Which channel to stop a MixMonitor on (may be NULL if mixmon_id is provided)
103  * \param mixmon_id Which mixmon_id should be stopped (may be NULL if chan is provided)
104  *
105  * \retval 0 if successful
106  * \retval non-zero on failure
107  */
108 int ast_stop_mixmonitor(struct ast_channel *chan, const char *mixmon_id);
109 
110 #endif /* ASTERISK_MIX_MONITOR_H */
Main Channel structure associated with a channel.
int(* ast_mixmonitor_stop_fn)(struct ast_channel *chan, const char *mixmon_id)
Stop a mixmonitor on a channel.
Definition: mixmonitor.h:52
int ast_start_mixmonitor(struct ast_channel *chan, const char *filename, const char *options)
Start a mixmonitor on a channel with the given parameters.
Definition: mixmonitor.c:74
int ast_set_mixmonitor_methods(struct ast_mixmonitor_methods *vmethod_table)
Setup MixMonitor virtual methods table. Use this to provide the MixMonitor functionality from a loada...
Definition: mixmonitor.c:43
MixMonitor virtual methods table definition.
Definition: mixmonitor.h:58
int ast_stop_mixmonitor(struct ast_channel *chan, const char *mixmon_id)
Stop a mixmonitor on a channel with the given parameters.
Definition: mixmonitor.c:86
int(* ast_mixmonitor_start_fn)(struct ast_channel *chan, const char *filename, const char *options)
Start a mixmonitor on a channel.
Definition: mixmonitor.h:40
int ast_clear_mixmonitor_methods(void)
Clear the MixMonitor virtual methods table. Use this to cleanup function pointers provided by a modul...
Definition: mixmonitor.c:59
ast_mixmonitor_stop_fn stop
Definition: mixmonitor.h:60
static struct test_options options
ast_mixmonitor_start_fn start
Definition: mixmonitor.h:59