Asterisk - The Open Source Telephony Project  18.5.0
resource_bridges.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012 - 2013, Digium, Inc.
5  *
6  * David M. Lee, II <[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 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 <[email protected]>
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 /*! Argument struct for ast_ari_bridges_list() */
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 /*! Argument struct for ast_ari_bridges_create() */
55  /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single). */
56  const char *type;
57  /*! Unique ID to give to the bridge being created. */
58  const char *bridge_id;
59  /*! 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  */
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 /*! Argument struct for ast_ari_bridges_create_with_id() */
85  /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single) to set. */
86  const char *type;
87  /*! Unique ID to give to the bridge being created. */
88  const char *bridge_id;
89  /*! 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  */
100  struct ast_json *body,
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_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_with_id_args *args, struct ast_ari_response *response);
113 /*! Argument struct for ast_ari_bridges_get() */
115  /*! 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 /*! Argument struct for ast_ari_bridges_destroy() */
128  /*! 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 /*! Argument struct for ast_ari_bridges_add_channel() */
143  /*! Bridge's id */
144  const char *bridge_id;
145  /*! Array of Ids of channels to add to bridge */
146  const char **channel;
147  /*! Length of channel array. */
149  /*! Parsing context for channel. */
151  /*! Channel's role in the bridge */
152  const char *role;
153  /*! Absorb DTMF coming from this channel, preventing it to pass through to the bridge */
155  /*! Mute audio from this channel, preventing it to pass through to the bridge */
156  int mute;
157  /*! Do not present the identity of the newly connected channel to other bridge members */
159 };
160 /*!
161  * \brief Body parsing function for /bridges/{bridgeId}/addChannel.
162  * \param body The JSON body from which to parse parameters.
163  * \param[out] args The args structure to parse into.
164  * \retval zero on success
165  * \retval non-zero on failure
166  */
168  struct ast_json *body,
169  struct ast_ari_bridges_add_channel_args *args);
170 
171 /*!
172  * \brief Add a channel to a bridge.
173  *
174  * \param headers HTTP headers
175  * \param args Swagger parameters
176  * \param[out] response HTTP response
177  */
178 void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response);
179 /*! Argument struct for ast_ari_bridges_remove_channel() */
181  /*! Bridge's id */
182  const char *bridge_id;
183  /*! Array of Ids of channels to remove from bridge */
184  const char **channel;
185  /*! Length of channel array. */
187  /*! Parsing context for channel. */
189 };
190 /*!
191  * \brief Body parsing function for /bridges/{bridgeId}/removeChannel.
192  * \param body The JSON body from which to parse parameters.
193  * \param[out] args The args structure to parse into.
194  * \retval zero on success
195  * \retval non-zero on failure
196  */
198  struct ast_json *body,
200 
201 /*!
202  * \brief Remove a channel from a bridge.
203  *
204  * \param headers HTTP headers
205  * \param args Swagger parameters
206  * \param[out] response HTTP response
207  */
208 void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response);
209 /*! Argument struct for ast_ari_bridges_set_video_source() */
211  /*! Bridge's id */
212  const char *bridge_id;
213  /*! Channel's id */
214  const char *channel_id;
215 };
216 /*!
217  * \brief Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.
218  *
219  * \param headers HTTP headers
220  * \param args Swagger parameters
221  * \param[out] response HTTP response
222  */
224 /*! Argument struct for ast_ari_bridges_clear_video_source() */
226  /*! Bridge's id */
227  const char *bridge_id;
228 };
229 /*!
230  * \brief Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.
231  *
232  * \param headers HTTP headers
233  * \param args Swagger parameters
234  * \param[out] response HTTP response
235  */
237 /*! Argument struct for ast_ari_bridges_start_moh() */
239  /*! Bridge's id */
240  const char *bridge_id;
241  /*! Channel's id */
242  const char *moh_class;
243 };
244 /*!
245  * \brief Body parsing function for /bridges/{bridgeId}/moh.
246  * \param body The JSON body from which to parse parameters.
247  * \param[out] args The args structure to parse into.
248  * \retval zero on success
249  * \retval non-zero on failure
250  */
252  struct ast_json *body,
253  struct ast_ari_bridges_start_moh_args *args);
254 
255 /*!
256  * \brief Play music on hold to a bridge or change the MOH class that is playing.
257  *
258  * \param headers HTTP headers
259  * \param args Swagger parameters
260  * \param[out] response HTTP response
261  */
262 void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response);
263 /*! Argument struct for ast_ari_bridges_stop_moh() */
265  /*! Bridge's id */
266  const char *bridge_id;
267 };
268 /*!
269  * \brief Stop playing music on hold to a bridge.
270  *
271  * This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
272  *
273  * \param headers HTTP headers
274  * \param args Swagger parameters
275  * \param[out] response HTTP response
276  */
277 void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response);
278 /*! Argument struct for ast_ari_bridges_play() */
280  /*! Bridge's id */
281  const char *bridge_id;
282  /*! Array of Media URIs to play. */
283  const char **media;
284  /*! Length of media array. */
285  size_t media_count;
286  /*! Parsing context for media. */
287  char *media_parse;
288  /*! For sounds, selects language for sound. */
289  const char *lang;
290  /*! Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified. */
291  int offsetms;
292  /*! Number of milliseconds to skip for forward/reverse operations. */
293  int skipms;
294  /*! Playback Id. */
295  const char *playback_id;
296 };
297 /*!
298  * \brief Body parsing function for /bridges/{bridgeId}/play.
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  */
305  struct ast_json *body,
306  struct ast_ari_bridges_play_args *args);
307 
308 /*!
309  * \brief Start playback of media on a bridge.
310  *
311  * 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.)
312  *
313  * \param headers HTTP headers
314  * \param args Swagger parameters
315  * \param[out] response HTTP response
316  */
317 void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response);
318 /*! Argument struct for ast_ari_bridges_play_with_id() */
320  /*! Bridge's id */
321  const char *bridge_id;
322  /*! Playback ID. */
323  const char *playback_id;
324  /*! Array of Media URIs to play. */
325  const char **media;
326  /*! Length of media array. */
327  size_t media_count;
328  /*! Parsing context for media. */
329  char *media_parse;
330  /*! For sounds, selects language for sound. */
331  const char *lang;
332  /*! Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified. */
333  int offsetms;
334  /*! Number of milliseconds to skip for forward/reverse operations. */
335  int skipms;
336 };
337 /*!
338  * \brief Body parsing function for /bridges/{bridgeId}/play/{playbackId}.
339  * \param body The JSON body from which to parse parameters.
340  * \param[out] args The args structure to parse into.
341  * \retval zero on success
342  * \retval non-zero on failure
343  */
345  struct ast_json *body,
346  struct ast_ari_bridges_play_with_id_args *args);
347 
348 /*!
349  * \brief Start playback of media on a bridge.
350  *
351  * 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.)
352  *
353  * \param headers HTTP headers
354  * \param args Swagger parameters
355  * \param[out] response HTTP response
356  */
357 void ast_ari_bridges_play_with_id(struct ast_variable *headers, struct ast_ari_bridges_play_with_id_args *args, struct ast_ari_response *response);
358 /*! Argument struct for ast_ari_bridges_record() */
360  /*! Bridge's id */
361  const char *bridge_id;
362  /*! Recording's filename */
363  const char *name;
364  /*! Format to encode audio in */
365  const char *format;
366  /*! Maximum duration of the recording, in seconds. 0 for no limit. */
368  /*! Maximum duration of silence, in seconds. 0 for no limit. */
370  /*! Action to take if a recording with the same name already exists. */
371  const char *if_exists;
372  /*! Play beep when recording begins */
373  int beep;
374  /*! DTMF input to terminate recording. */
375  const char *terminate_on;
376 };
377 /*!
378  * \brief Body parsing function for /bridges/{bridgeId}/record.
379  * \param body The JSON body from which to parse parameters.
380  * \param[out] args The args structure to parse into.
381  * \retval zero on success
382  * \retval non-zero on failure
383  */
385  struct ast_json *body,
386  struct ast_ari_bridges_record_args *args);
387 
388 /*!
389  * \brief Start a recording.
390  *
391  * This records the mixed audio from all channels participating in this bridge.
392  *
393  * \param headers HTTP headers
394  * \param args Swagger parameters
395  * \param[out] response HTTP response
396  */
397 void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response);
398 
399 #endif /* _ASTERISK_RESOURCE_BRIDGES_H */
int ast_ari_bridges_remove_channel_parse_body(struct ast_json *body, struct ast_ari_bridges_remove_channel_args *args)
Body parsing function for /bridges/{bridgeId}/removeChannel.
Structure for variables, used for configurations and for channel variables.
void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response)
Create a new bridge.
void ast_ari_bridges_play_with_id(struct ast_variable *headers, struct ast_ari_bridges_play_with_id_args *args, struct ast_ari_response *response)
Start playback of media on a bridge.
int ast_ari_bridges_create_with_id_parse_body(struct ast_json *body, struct ast_ari_bridges_create_with_id_args *args)
Body parsing function for /bridges/{bridgeId}.
int ast_ari_bridges_play_with_id_parse_body(struct ast_json *body, struct ast_ari_bridges_play_with_id_args *args)
Body parsing function for /bridges/{bridgeId}/play/{playbackId}.
Asterisk RESTful API hooks.
void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response)
Stop playing music on hold to a bridge.
const char * args
void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response)
Remove a channel from a bridge.
void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response)
Start a recording.
void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response)
Start playback of media on a bridge.
void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response)
Add a channel to a bridge.
void ast_ari_bridges_destroy(struct ast_variable *headers, struct ast_ari_bridges_destroy_args *args, struct ast_ari_response *response)
Shut down a bridge.
int ast_ari_bridges_start_moh_parse_body(struct ast_json *body, struct ast_ari_bridges_start_moh_args *args)
Body parsing function for /bridges/{bridgeId}/moh.
void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response)
List all active bridges in Asterisk.
void ast_ari_bridges_create_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_with_id_args *args, struct ast_ari_response *response)
Create a new bridge or updates an existing one.
void ast_ari_bridges_clear_video_source(struct ast_variable *headers, struct ast_ari_bridges_clear_video_source_args *args, struct ast_ari_response *response)
Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bri...
void ast_ari_bridges_set_video_source(struct ast_variable *headers, struct ast_ari_bridges_set_video_source_args *args, struct ast_ari_response *response)
Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bri...
int ast_ari_bridges_add_channel_parse_body(struct ast_json *body, struct ast_ari_bridges_add_channel_args *args)
Body parsing function for /bridges/{bridgeId}/addChannel.
int ast_ari_bridges_record_parse_body(struct ast_json *body, struct ast_ari_bridges_record_args *args)
Body parsing function for /bridges/{bridgeId}/record.
int ast_ari_bridges_play_parse_body(struct ast_json *body, struct ast_ari_bridges_play_args *args)
Body parsing function for /bridges/{bridgeId}/play.
Abstract JSON element (object, array, string, int, ...).
int ast_ari_bridges_create_parse_body(struct ast_json *body, struct ast_ari_bridges_create_args *args)
Body parsing function for /bridges.
void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response)
Play music on hold to a bridge or change the MOH class that is playing.
void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response)
Get bridge details.