Debian Codegraph @

res/ari/resource_bridges.h

raw symbols SCIP
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() */
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 /*! Argument struct for ast_ari_bridges_create() */
54 struct ast_ari_bridges_create_args {
55 /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single, sdp_label). */
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 /*! The "variables" key in the body object holds variable key/value pairs to set on the bridge on creation. Each variable is an object containing "value" (string) and optional "report_events" (boolean) to include updates for that variable in bridge events (defaults to false). Ex. { "name": "SupportBridge", "variables": { "Bridge_State": { "value": "WaitingForAgent", "report_events": true } } } */
62 struct ast_json *variables;
63 };
64 /*!
65 * \brief Body parsing function for /bridges.
66 * \param body The JSON body from which to parse parameters.
67 * \param[out] args The args structure to parse into.
68 * \retval zero on success
69 * \retval non-zero on failure
70 */
71 int ast_ari_bridges_create_parse_body(
72 struct ast_json *body,
73 struct ast_ari_bridges_create_args *args);
74
75 /*!
76 * \brief Create a new bridge.
77 *
78 * This bridge persists until it has been shut down, or Asterisk has been shut down.
79 *
80 * \param headers HTTP headers
81 * \param args Swagger parameters
82 * \param[out] response HTTP response
83 */
84 void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
85 /*! Argument struct for ast_ari_bridges_create_with_id() */
86 struct ast_ari_bridges_create_with_id_args {
87 /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single, sdp_label) to set. */
88 const char *type;
89 /*! Unique ID to give to the bridge being created. */
90 const char *bridge_id;
91 /*! Set the name of the bridge. */
92 const char *name;
93 /*! The "variables" key in the body object holds variable key/value pairs to set on the bridge on creation. Each variable is an object containing "value" (string) and optional "report_events" (boolean) to include updates for that variable in bridge events (defaults to false). Ex. { "name": "SupportBridge", "variables": { "Bridge_State": { "value": "WaitingForAgent", "report_events": true } } } */
94 struct ast_json *variables;
95 };
96 /*!
97 * \brief Body parsing function for /bridges/{bridgeId}.
98 * \param body The JSON body from which to parse parameters.
99 * \param[out] args The args structure to parse into.
100 * \retval zero on success
101 * \retval non-zero on failure
102 */
103 int ast_ari_bridges_create_with_id_parse_body(
104 struct ast_json *body,
105 struct ast_ari_bridges_create_with_id_args *args);
106
107 /*!
108 * \brief Create a new bridge.
109 *
110 * This bridge persists until it has been shut down, or Asterisk has been shut down.
111 *
112 * \param headers HTTP headers
113 * \param args Swagger parameters
114 * \param[out] response HTTP response
115 */
116 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);
117 /*! Argument struct for ast_ari_bridges_get() */
118 struct ast_ari_bridges_get_args {
119 /*! Bridge's id */
120 const char *bridge_id;
121 };
122 /*!
123 * \brief Get bridge details.
124 *
125 * \param headers HTTP headers
126 * \param args Swagger parameters
127 * \param[out] response HTTP response
128 */
129 void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response);
130 /*! Argument struct for ast_ari_bridges_destroy() */
131 struct ast_ari_bridges_destroy_args {
132 /*! Bridge's id */
133 const char *bridge_id;
134 };
135 /*!
136 * \brief Shut down a bridge.
137 *
138 * If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.
139 *
140 * \param headers HTTP headers
141 * \param args Swagger parameters
142 * \param[out] response HTTP response
143 */
144 void ast_ari_bridges_destroy(struct ast_variable *headers, struct ast_ari_bridges_destroy_args *args, struct ast_ari_response *response);
145 /*! Argument struct for ast_ari_bridges_get_bridge_var() */
146 struct ast_ari_bridges_get_bridge_var_args {
147 /*! Bridge's id */
148 const char *bridge_id;
149 /*! The bridge variable or function to get */
150 const char *variable;
151 };
152 /*!
153 * \brief Body parsing function for /bridges/{bridgeId}/variable.
154 * \param body The JSON body from which to parse parameters.
155 * \param[out] args The args structure to parse into.
156 * \retval zero on success
157 * \retval non-zero on failure
158 */
159 int ast_ari_bridges_get_bridge_var_parse_body(
160 struct ast_json *body,
161 struct ast_ari_bridges_get_bridge_var_args *args);
162
163 /*!
164 * \brief Get the value of a bridge variable or function.
165 *
166 * \param headers HTTP headers
167 * \param args Swagger parameters
168 * \param[out] response HTTP response
169 */
170 void ast_ari_bridges_get_bridge_var(struct ast_variable *headers, struct ast_ari_bridges_get_bridge_var_args *args, struct ast_ari_response *response);
171 /*! Argument struct for ast_ari_bridges_set_bridge_var() */
172 struct ast_ari_bridges_set_bridge_var_args {
173 /*! Bridge's id */
174 const char *bridge_id;
175 /*! The bridge variable or function to set */
176 const char *variable;
177 /*! The value to set the variable to */
178 const char *value;
179 /*! Whether this variable should be included in bridge events. Defaults to false. */
180 int report_events;
181 };
182 /*!
183 * \brief Body parsing function for /bridges/{bridgeId}/variable.
184 * \param body The JSON body from which to parse parameters.
185 * \param[out] args The args structure to parse into.
186 * \retval zero on success
187 * \retval non-zero on failure
188 */
189 int ast_ari_bridges_set_bridge_var_parse_body(
190 struct ast_json *body,
191 struct ast_ari_bridges_set_bridge_var_args *args);
192
193 /*!
194 * \brief Set the value of a bridge variable or function.
195 *
196 * \param headers HTTP headers
197 * \param args Swagger parameters
198 * \param[out] response HTTP response
199 */
200 void ast_ari_bridges_set_bridge_var(struct ast_variable *headers, struct ast_ari_bridges_set_bridge_var_args *args, struct ast_ari_response *response);
201 /*! Argument struct for ast_ari_bridges_get_bridge_vars() */
202 struct ast_ari_bridges_get_bridge_vars_args {
203 /*! Bridge's id */
204 const char *bridge_id;
205 /*! Array of The bridge variables or functions to get */
206 const char **variables;
207 /*! Length of variables array. */
208 size_t variables_count;
209 /*! Parsing context for variables. */
210 char *variables_parse;
211 };
212 /*!
213 * \brief Body parsing function for /bridges/{bridgeId}/variables.
214 * \param body The JSON body from which to parse parameters.
215 * \param[out] args The args structure to parse into.
216 * \retval zero on success
217 * \retval non-zero on failure
218 */
219 int ast_ari_bridges_get_bridge_vars_parse_body(
220 struct ast_json *body,
221 struct ast_ari_bridges_get_bridge_vars_args *args);
222
223 /*!
224 * \brief Get the value of multiple bridge variables or functions.
225 *
226 * \param headers HTTP headers
227 * \param args Swagger parameters
228 * \param[out] response HTTP response
229 */
230 void ast_ari_bridges_get_bridge_vars(struct ast_variable *headers, struct ast_ari_bridges_get_bridge_vars_args *args, struct ast_ari_response *response);
231 /*! Argument struct for ast_ari_bridges_set_bridge_vars() */
232 struct ast_ari_bridges_set_bridge_vars_args {
233 /*! Bridge's id */
234 const char *bridge_id;
235 /*! The "variables" key in the body object holds variable key/value pairs to set on the bridge. Each variable value may be either a string or an object containing "value" (string) and optional "report_events" (boolean) to include updates for that variable in bridge events (defaults to false). Ex. { "variables": { "Bridge_State": "WaitingForAgent", "Support_Level": { "value": "Premium", "report_events": true } } } */
236 struct ast_json *variables;
237 };
238 /*!
239 * \brief Body parsing function for /bridges/{bridgeId}/variables.
240 * \param body The JSON body from which to parse parameters.
241 * \param[out] args The args structure to parse into.
242 * \retval zero on success
243 * \retval non-zero on failure
244 */
245 int ast_ari_bridges_set_bridge_vars_parse_body(
246 struct ast_json *body,
247 struct ast_ari_bridges_set_bridge_vars_args *args);
248
249 /*!
250 * \brief Set the values of multiple bridge variables or functions.
251 *
252 * \param headers HTTP headers
253 * \param args Swagger parameters
254 * \param[out] response HTTP response
255 */
256 void ast_ari_bridges_set_bridge_vars(struct ast_variable *headers, struct ast_ari_bridges_set_bridge_vars_args *args, struct ast_ari_response *response);
257 /*! Argument struct for ast_ari_bridges_add_channel() */
258 struct ast_ari_bridges_add_channel_args {
259 /*! Bridge's id */
260 const char *bridge_id;
261 /*! Array of Ids of channels to add to bridge */
262 const char **channel;
263 /*! Length of channel array. */
264 size_t channel_count;
265 /*! Parsing context for channel. */
266 char *channel_parse;
267 /*! Channel's role in the bridge */
268 const char *role;
269 /*! Absorb DTMF coming from this channel, preventing it to pass through to the bridge */
270 int absorb_dtmf;
271 /*! Mute audio from this channel, preventing it to pass through to the bridge */
272 int mute;
273 /*! Do not present the identity of the newly connected channel to other bridge members */
274 int inhibit_connected_line_updates;
275 };
276 /*!
277 * \brief Body parsing function for /bridges/{bridgeId}/addChannel.
278 * \param body The JSON body from which to parse parameters.
279 * \param[out] args The args structure to parse into.
280 * \retval zero on success
281 * \retval non-zero on failure
282 */
283 int ast_ari_bridges_add_channel_parse_body(
284 struct ast_json *body,
285 struct ast_ari_bridges_add_channel_args *args);
286
287 /*!
288 * \brief Add a channel to a bridge.
289 *
290 * \param headers HTTP headers
291 * \param args Swagger parameters
292 * \param[out] response HTTP response
293 */
294 void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response);
295 /*! Argument struct for ast_ari_bridges_remove_channel() */
296 struct ast_ari_bridges_remove_channel_args {
297 /*! Bridge's id */
298 const char *bridge_id;
299 /*! Array of Ids of channels to remove from bridge */
300 const char **channel;
301 /*! Length of channel array. */
302 size_t channel_count;
303 /*! Parsing context for channel. */
304 char *channel_parse;
305 };
306 /*!
307 * \brief Body parsing function for /bridges/{bridgeId}/removeChannel.
308 * \param body The JSON body from which to parse parameters.
309 * \param[out] args The args structure to parse into.
310 * \retval zero on success
311 * \retval non-zero on failure
312 */
313 int ast_ari_bridges_remove_channel_parse_body(
314 struct ast_json *body,
315 struct ast_ari_bridges_remove_channel_args *args);
316
317 /*!
318 * \brief Remove a channel from a bridge.
319 *
320 * \param headers HTTP headers
321 * \param args Swagger parameters
322 * \param[out] response HTTP response
323 */
324 void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response);
325 /*! Argument struct for ast_ari_bridges_set_video_source() */
326 struct ast_ari_bridges_set_video_source_args {
327 /*! Bridge's id */
328 const char *bridge_id;
329 /*! Channel's id */
330 const char *channel_id;
331 };
332 /*!
333 * \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.
334 *
335 * \param headers HTTP headers
336 * \param args Swagger parameters
337 * \param[out] response HTTP response
338 */
339 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);
340 /*! Argument struct for ast_ari_bridges_clear_video_source() */
341 struct ast_ari_bridges_clear_video_source_args {
342 /*! Bridge's id */
343 const char *bridge_id;
344 };
345 /*!
346 * \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.
347 *
348 * \param headers HTTP headers
349 * \param args Swagger parameters
350 * \param[out] response HTTP response
351 */
352 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);
353 /*! Argument struct for ast_ari_bridges_start_moh() */
354 struct ast_ari_bridges_start_moh_args {
355 /*! Bridge's id */
356 const char *bridge_id;
357 /*! Channel's id */
358 const char *moh_class;
359 };
360 /*!
361 * \brief Body parsing function for /bridges/{bridgeId}/moh.
362 * \param body The JSON body from which to parse parameters.
363 * \param[out] args The args structure to parse into.
364 * \retval zero on success
365 * \retval non-zero on failure
366 */
367 int ast_ari_bridges_start_moh_parse_body(
368 struct ast_json *body,
369 struct ast_ari_bridges_start_moh_args *args);
370
371 /*!
372 * \brief Play music on hold to a bridge or change the MOH class that is playing.
373 *
374 * \param headers HTTP headers
375 * \param args Swagger parameters
376 * \param[out] response HTTP response
377 */
378 void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response);
379 /*! Argument struct for ast_ari_bridges_stop_moh() */
380 struct ast_ari_bridges_stop_moh_args {
381 /*! Bridge's id */
382 const char *bridge_id;
383 };
384 /*!
385 * \brief Stop playing music on hold to a bridge.
386 *
387 * This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
388 *
389 * \param headers HTTP headers
390 * \param args Swagger parameters
391 * \param[out] response HTTP response
392 */
393 void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response);
394 /*! Argument struct for ast_ari_bridges_play() */
395 struct ast_ari_bridges_play_args {
396 /*! Bridge's id */
397 const char *bridge_id;
398 /*! Array of Media URIs to play. */
399 const char **media;
400 /*! Length of media array. */
401 size_t media_count;
402 /*! Parsing context for media. */
403 char *media_parse;
404 /*! Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate. */
405 const char *announcer_format;
406 /*! For sounds, selects language for sound. */
407 const char *lang;
408 /*! Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified. */
409 int offsetms;
410 /*! Number of milliseconds to skip for forward/reverse operations. */
411 int skipms;
412 /*! Playback Id. */
413 const char *playback_id;
414 };
415 /*!
416 * \brief Body parsing function for /bridges/{bridgeId}/play.
417 * \param body The JSON body from which to parse parameters.
418 * \param[out] args The args structure to parse into.
419 * \retval zero on success
420 * \retval non-zero on failure
421 */
422 int ast_ari_bridges_play_parse_body(
423 struct ast_json *body,
424 struct ast_ari_bridges_play_args *args);
425
426 /*!
427 * \brief Start playback of media on a bridge.
428 *
429 * 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.)
430 *
431 * \param headers HTTP headers
432 * \param args Swagger parameters
433 * \param[out] response HTTP response
434 */
435 void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response);
436 /*! Argument struct for ast_ari_bridges_play_with_id() */
437 struct ast_ari_bridges_play_with_id_args {
438 /*! Bridge's id */
439 const char *bridge_id;
440 /*! Playback ID. */
441 const char *playback_id;
442 /*! Array of Media URIs to play. */
443 const char **media;
444 /*! Length of media array. */
445 size_t media_count;
446 /*! Parsing context for media. */
447 char *media_parse;
448 /*! Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate. */
449 const char *announcer_format;
450 /*! For sounds, selects language for sound. */
451 const char *lang;
452 /*! Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified. */
453 int offsetms;
454 /*! Number of milliseconds to skip for forward/reverse operations. */
455 int skipms;
456 };
457 /*!
458 * \brief Body parsing function for /bridges/{bridgeId}/play/{playbackId}.
459 * \param body The JSON body from which to parse parameters.
460 * \param[out] args The args structure to parse into.
461 * \retval zero on success
462 * \retval non-zero on failure
463 */
464 int ast_ari_bridges_play_with_id_parse_body(
465 struct ast_json *body,
466 struct ast_ari_bridges_play_with_id_args *args);
467
468 /*!
469 * \brief Start playback of media on a bridge.
470 *
471 * 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.)
472 *
473 * \param headers HTTP headers
474 * \param args Swagger parameters
475 * \param[out] response HTTP response
476 */
477 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);
478 /*! Argument struct for ast_ari_bridges_record() */
479 struct ast_ari_bridges_record_args {
480 /*! Bridge's id */
481 const char *bridge_id;
482 /*! Recording's filename */
483 const char *name;
484 /*! Format to encode audio in */
485 const char *format;
486 /*! Format of the 'Recorder' channel attached to the bridge. Defaults to the same format as the 'format' parameter. */
487 const char *recorder_format;
488 /*! Maximum duration of the recording, in seconds. 0 for no limit. */
489 int max_duration_seconds;
490 /*! Maximum duration of silence, in seconds. 0 for no limit. */
491 int max_silence_seconds;
492 /*! Action to take if a recording with the same name already exists. */
493 const char *if_exists;
494 /*! Play beep when recording begins */
495 int beep;
496 /*! DTMF input to terminate recording. */
497 const char *terminate_on;
498 };
499 /*!
500 * \brief Body parsing function for /bridges/{bridgeId}/record.
501 * \param body The JSON body from which to parse parameters.
502 * \param[out] args The args structure to parse into.
503 * \retval zero on success
504 * \retval non-zero on failure
505 */
506 int ast_ari_bridges_record_parse_body(
507 struct ast_json *body,
508 struct ast_ari_bridges_record_args *args);
509
510 /*!
511 * \brief Start a recording.
512 *
513 * This records the mixed audio from all channels participating in this bridge.
514 *
515 * \param headers HTTP headers
516 * \param args Swagger parameters
517 * \param[out] response HTTP response
518 */
519 void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response);
520
521 #endif /* _ASTERISK_RESOURCE_BRIDGES_H */