ARI: Add tones playback resource
[asterisk/asterisk.git] / res / ari / resource_bridges.h
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012 - 2013, Digium, Inc.
5  *
6  * David M. Lee, II <dlee@digium.com>
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 Generated file - declares stubs to be implemented in
22  * res/ari/resource_bridges.c
23  *
24  * Bridge resources
25  *
26  * \author David M. Lee, II <dlee@digium.com>
27  */
28
29 /*
30  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31  * !!!!!                               DO NOT EDIT                        !!!!!
32  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33  * This file is generated by a mustache template. Please see the original
34  * template in rest-api-templates/ari_resource.h.mustache
35  */
36
37 #ifndef _ASTERISK_RESOURCE_BRIDGES_H
38 #define _ASTERISK_RESOURCE_BRIDGES_H
39
40 #include "asterisk/ari.h"
41
42 /*! \brief Argument struct for ast_ari_bridges_list() */
43 struct ast_ari_bridges_list_args {
44 };
45 /*!
46  * \brief List all active bridges in Asterisk.
47  *
48  * \param headers HTTP headers
49  * \param args Swagger parameters
50  * \param[out] response HTTP response
51  */
52 void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);
53 /*! \brief Argument struct for ast_ari_bridges_create() */
54 struct ast_ari_bridges_create_args {
55         /*! \brief Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media). */
56         const char *type;
57         /*! \brief Unique ID to give to the bridge being created. */
58         const char *bridge_id;
59         /*! \brief Name to give to the bridge being created. */
60         const char *name;
61 };
62 /*!
63  * \brief Body parsing function for /bridges.
64  * \param body The JSON body from which to parse parameters.
65  * \param[out] args The args structure to parse into.
66  * \retval zero on success
67  * \retval non-zero on failure
68  */
69 int ast_ari_bridges_create_parse_body(
70         struct ast_json *body,
71         struct ast_ari_bridges_create_args *args);
72
73 /*!
74  * \brief Create a new bridge.
75  *
76  * This bridge persists until it has been shut down, or Asterisk has been shut down.
77  *
78  * \param headers HTTP headers
79  * \param args Swagger parameters
80  * \param[out] response HTTP response
81  */
82 void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
83 /*! \brief Argument struct for ast_ari_bridges_create_or_update_with_id() */
84 struct ast_ari_bridges_create_or_update_with_id_args {
85         /*! \brief Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set. */
86         const char *type;
87         /*! \brief Unique ID to give to the bridge being created. */
88         const char *bridge_id;
89         /*! \brief Set the name of the bridge. */
90         const char *name;
91 };
92 /*!
93  * \brief Body parsing function for /bridges/{bridgeId}.
94  * \param body The JSON body from which to parse parameters.
95  * \param[out] args The args structure to parse into.
96  * \retval zero on success
97  * \retval non-zero on failure
98  */
99 int ast_ari_bridges_create_or_update_with_id_parse_body(
100         struct ast_json *body,
101         struct ast_ari_bridges_create_or_update_with_id_args *args);
102
103 /*!
104  * \brief Create a new bridge or updates an existing one.
105  *
106  * This bridge persists until it has been shut down, or Asterisk has been shut down.
107  *
108  * \param headers HTTP headers
109  * \param args Swagger parameters
110  * \param[out] response HTTP response
111  */
112 void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_or_update_with_id_args *args, struct ast_ari_response *response);
113 /*! \brief Argument struct for ast_ari_bridges_get() */
114 struct ast_ari_bridges_get_args {
115         /*! \brief Bridge's id */
116         const char *bridge_id;
117 };
118 /*!
119  * \brief Get bridge details.
120  *
121  * \param headers HTTP headers
122  * \param args Swagger parameters
123  * \param[out] response HTTP response
124  */
125 void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response);
126 /*! \brief Argument struct for ast_ari_bridges_destroy() */
127 struct ast_ari_bridges_destroy_args {
128         /*! \brief Bridge's id */
129         const char *bridge_id;
130 };
131 /*!
132  * \brief Shut down a bridge.
133  *
134  * If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.
135  *
136  * \param headers HTTP headers
137  * \param args Swagger parameters
138  * \param[out] response HTTP response
139  */
140 void ast_ari_bridges_destroy(struct ast_variable *headers, struct ast_ari_bridges_destroy_args *args, struct ast_ari_response *response);
141 /*! \brief Argument struct for ast_ari_bridges_add_channel() */
142 struct ast_ari_bridges_add_channel_args {
143         /*! \brief Bridge's id */
144         const char *bridge_id;
145         /*! \brief Array of Ids of channels to add to bridge */
146         const char **channel;
147         /*! \brief Length of channel array. */
148         size_t channel_count;
149         /*! \brief Parsing context for channel. */
150         char *channel_parse;
151         /*! \brief Channel's role in the bridge */
152         const char *role;
153 };
154 /*!
155  * \brief Body parsing function for /bridges/{bridgeId}/addChannel.
156  * \param body The JSON body from which to parse parameters.
157  * \param[out] args The args structure to parse into.
158  * \retval zero on success
159  * \retval non-zero on failure
160  */
161 int ast_ari_bridges_add_channel_parse_body(
162         struct ast_json *body,
163         struct ast_ari_bridges_add_channel_args *args);
164
165 /*!
166  * \brief Add a channel to a bridge.
167  *
168  * \param headers HTTP headers
169  * \param args Swagger parameters
170  * \param[out] response HTTP response
171  */
172 void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response);
173 /*! \brief Argument struct for ast_ari_bridges_remove_channel() */
174 struct ast_ari_bridges_remove_channel_args {
175         /*! \brief Bridge's id */
176         const char *bridge_id;
177         /*! \brief Array of Ids of channels to remove from bridge */
178         const char **channel;
179         /*! \brief Length of channel array. */
180         size_t channel_count;
181         /*! \brief Parsing context for channel. */
182         char *channel_parse;
183 };
184 /*!
185  * \brief Body parsing function for /bridges/{bridgeId}/removeChannel.
186  * \param body The JSON body from which to parse parameters.
187  * \param[out] args The args structure to parse into.
188  * \retval zero on success
189  * \retval non-zero on failure
190  */
191 int ast_ari_bridges_remove_channel_parse_body(
192         struct ast_json *body,
193         struct ast_ari_bridges_remove_channel_args *args);
194
195 /*!
196  * \brief Remove a channel from a bridge.
197  *
198  * \param headers HTTP headers
199  * \param args Swagger parameters
200  * \param[out] response HTTP response
201  */
202 void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response);
203 /*! \brief Argument struct for ast_ari_bridges_start_moh() */
204 struct ast_ari_bridges_start_moh_args {
205         /*! \brief Bridge's id */
206         const char *bridge_id;
207         /*! \brief Channel's id */
208         const char *moh_class;
209 };
210 /*!
211  * \brief Body parsing function for /bridges/{bridgeId}/moh.
212  * \param body The JSON body from which to parse parameters.
213  * \param[out] args The args structure to parse into.
214  * \retval zero on success
215  * \retval non-zero on failure
216  */
217 int ast_ari_bridges_start_moh_parse_body(
218         struct ast_json *body,
219         struct ast_ari_bridges_start_moh_args *args);
220
221 /*!
222  * \brief Play music on hold to a bridge or change the MOH class that is playing.
223  *
224  * \param headers HTTP headers
225  * \param args Swagger parameters
226  * \param[out] response HTTP response
227  */
228 void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response);
229 /*! \brief Argument struct for ast_ari_bridges_stop_moh() */
230 struct ast_ari_bridges_stop_moh_args {
231         /*! \brief Bridge's id */
232         const char *bridge_id;
233 };
234 /*!
235  * \brief Stop playing music on hold to a bridge.
236  *
237  * This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
238  *
239  * \param headers HTTP headers
240  * \param args Swagger parameters
241  * \param[out] response HTTP response
242  */
243 void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response);
244 /*! \brief Argument struct for ast_ari_bridges_play() */
245 struct ast_ari_bridges_play_args {
246         /*! \brief Bridge's id */
247         const char *bridge_id;
248         /*! \brief Media's URI to play. */
249         const char *media;
250         /*! \brief For sounds, selects language for sound. */
251         const char *lang;
252         /*! \brief Number of media to skip before playing. */
253         int offsetms;
254         /*! \brief Number of milliseconds to skip for forward/reverse operations. */
255         int skipms;
256 };
257 /*!
258  * \brief Body parsing function for /bridges/{bridgeId}/play.
259  * \param body The JSON body from which to parse parameters.
260  * \param[out] args The args structure to parse into.
261  * \retval zero on success
262  * \retval non-zero on failure
263  */
264 int ast_ari_bridges_play_parse_body(
265         struct ast_json *body,
266         struct ast_ari_bridges_play_args *args);
267
268 /*!
269  * \brief Start playback of media on a bridge.
270  *
271  * The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)
272  *
273  * \param headers HTTP headers
274  * \param args Swagger parameters
275  * \param[out] response HTTP response
276  */
277 void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response);
278 /*! \brief Argument struct for ast_ari_bridges_record() */
279 struct ast_ari_bridges_record_args {
280         /*! \brief Bridge's id */
281         const char *bridge_id;
282         /*! \brief Recording's filename */
283         const char *name;
284         /*! \brief Format to encode audio in */
285         const char *format;
286         /*! \brief Maximum duration of the recording, in seconds. 0 for no limit. */
287         int max_duration_seconds;
288         /*! \brief Maximum duration of silence, in seconds. 0 for no limit. */
289         int max_silence_seconds;
290         /*! \brief Action to take if a recording with the same name already exists. */
291         const char *if_exists;
292         /*! \brief Play beep when recording begins */
293         int beep;
294         /*! \brief DTMF input to terminate recording. */
295         const char *terminate_on;
296 };
297 /*!
298  * \brief Body parsing function for /bridges/{bridgeId}/record.
299  * \param body The JSON body from which to parse parameters.
300  * \param[out] args The args structure to parse into.
301  * \retval zero on success
302  * \retval non-zero on failure
303  */
304 int ast_ari_bridges_record_parse_body(
305         struct ast_json *body,
306         struct ast_ari_bridges_record_args *args);
307
308 /*!
309  * \brief Start a recording.
310  *
311  * This records the mixed audio from all channels participating in this bridge.
312  *
313  * \param headers HTTP headers
314  * \param args Swagger parameters
315  * \param[out] response HTTP response
316  */
317 void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response);
318
319 #endif /* _ASTERISK_RESOURCE_BRIDGES_H */