Asterisk - The Open Source Telephony Project GIT-master-8f1982c
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
Macros | Functions | Variables
res_ari_bridges.c File Reference

Bridge resources. More...

#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app.h"
#include "ari/resource_bridges.h"
Include dependency graph for res_ari_bridges.c:

Go to the source code of this file.

Macros

#define MAX_VALS   128
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static void ast_ari_bridges_add_channel_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/addChannel. More...
 
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. More...
 
static void ast_ari_bridges_clear_video_source_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/videoSource. More...
 
static void ast_ari_bridges_create_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges. More...
 
int ast_ari_bridges_create_parse_body (struct ast_json *body, struct ast_ari_bridges_create_args *args)
 Body parsing function for /bridges. More...
 
static void ast_ari_bridges_create_with_id_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}. More...
 
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}. More...
 
static void ast_ari_bridges_destroy_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}. More...
 
static void ast_ari_bridges_get_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}. More...
 
static void ast_ari_bridges_list_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges. More...
 
static void ast_ari_bridges_play_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/play. More...
 
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. More...
 
static void ast_ari_bridges_play_with_id_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/play/{playbackId}. More...
 
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}. More...
 
static void ast_ari_bridges_record_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/record. More...
 
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. More...
 
static void ast_ari_bridges_remove_channel_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/removeChannel. More...
 
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. More...
 
static void ast_ari_bridges_set_video_source_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/videoSource/{channelId}. More...
 
static void ast_ari_bridges_start_moh_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/moh. More...
 
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. More...
 
static void ast_ari_bridges_stop_moh_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 Parameter parsing callback for /bridges/{bridgeId}/moh. More...
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "RESTful API module - Bridge resources" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari,res_ari_model,res_stasis,res_stasis_recording,res_stasis_playback", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct stasis_rest_handlers bridges
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_addChannel
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_moh
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_play
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_play_playbackId
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_record
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_removeChannel
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_videoSource
 REST handler for /api-docs/bridges.json. More...
 
static struct stasis_rest_handlers bridges_bridgeId_videoSource_channelId
 REST handler for /api-docs/bridges.json. More...
 

Detailed Description

Bridge resources.

Author
David M. Lee, II dlee@.nosp@m.digi.nosp@m.um.co.nosp@m.m

Definition in file res_ari_bridges.c.

Macro Definition Documentation

◆ MAX_VALS

#define MAX_VALS   128

Definition at line 53 of file res_ari_bridges.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 1618 of file res_ari_bridges.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 1618 of file res_ari_bridges.c.

◆ ast_ari_bridges_add_channel_cb()

static void ast_ari_bridges_add_channel_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/addChannel.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 471 of file res_ari_bridges.c.

475{
477 struct ast_variable *i;
478#if defined(AST_DEVMODE)
479 int is_valid;
480 int code;
481#endif /* AST_DEVMODE */
482
483 for (i = get_params; i; i = i->next) {
484 if (strcmp(i->name, "channel") == 0) {
485 /* Parse comma separated list */
486 char *vals[MAX_VALS];
487 size_t j;
488
489 args.channel_parse = ast_strdup(i->value);
490 if (!args.channel_parse) {
492 goto fin;
493 }
494
495 if (strlen(args.channel_parse) == 0) {
496 /* ast_app_separate_args can't handle "" */
497 args.channel_count = 1;
498 vals[0] = args.channel_parse;
499 } else {
500 args.channel_count = ast_app_separate_args(
501 args.channel_parse, ',', vals,
502 ARRAY_LEN(vals));
503 }
504
505 if (args.channel_count == 0) {
507 goto fin;
508 }
509
510 if (args.channel_count >= MAX_VALS) {
511 ast_ari_response_error(response, 400,
512 "Bad Request",
513 "Too many values for channel");
514 goto fin;
515 }
516
517 args.channel = ast_malloc(sizeof(*args.channel) * args.channel_count);
518 if (!args.channel) {
520 goto fin;
521 }
522
523 for (j = 0; j < args.channel_count; ++j) {
524 args.channel[j] = (vals[j]);
525 }
526 } else
527 if (strcmp(i->name, "role") == 0) {
528 args.role = (i->value);
529 } else
530 if (strcmp(i->name, "absorbDTMF") == 0) {
531 args.absorb_dtmf = ast_true(i->value);
532 } else
533 if (strcmp(i->name, "mute") == 0) {
534 args.mute = ast_true(i->value);
535 } else
536 if (strcmp(i->name, "inhibitConnectedLineUpdates") == 0) {
537 args.inhibit_connected_line_updates = ast_true(i->value);
538 } else
539 {}
540 }
541 for (i = path_vars; i; i = i->next) {
542 if (strcmp(i->name, "bridgeId") == 0) {
543 args.bridge_id = (i->value);
544 } else
545 {}
546 }
549 goto fin;
550 }
551 ast_ari_bridges_add_channel(headers, &args, response);
552#if defined(AST_DEVMODE)
553 code = response->response_code;
554
555 switch (code) {
556 case 0: /* Implementation is still a stub, or the code wasn't set */
557 is_valid = response->message == NULL;
558 break;
559 case 500: /* Internal Server Error */
560 case 501: /* Not Implemented */
561 case 400: /* Channel not found */
562 case 404: /* Bridge not found */
563 case 409: /* Bridge not in Stasis application; Channel currently recording */
564 case 422: /* Channel not in Stasis application */
565 is_valid = 1;
566 break;
567 default:
568 if (200 <= code && code <= 299) {
569 is_valid = ast_ari_validate_void(
570 response->message);
571 } else {
572 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/addChannel\n", code);
573 is_valid = 0;
574 }
575 }
576
577 if (!is_valid) {
578 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/addChannel\n");
579 ast_ari_response_error(response, 500,
580 "Internal Server Error", "Response validation failed");
581 }
582#endif /* AST_DEVMODE */
583
584fin: __attribute__((unused))
585 ast_free(args.channel_parse);
586 ast_free(args.channel);
587 return;
588}
void ast_ari_response_error(struct ast_ari_response *response, int response_code, const char *response_text, const char *message_fmt,...)
Fill in an error ast_ari_response.
Definition: res_ari.c:319
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
Definition: res_ari.c:358
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
#define ast_free(a)
Definition: astmm.h:180
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:241
#define ast_malloc(len)
A wrapper for malloc()
Definition: astmm.h:191
#define ast_log
Definition: astobj2.c:42
#define ast_app_separate_args(a, b, c, d)
#define LOG_ERROR
#define MAX_VALS
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.
#define NULL
Definition: resample.c:96
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.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
Definition: utils.c:2199
struct ast_json * message
Definition: ari.h:103
int response_code
Definition: ari.h:108
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
const char * args
#define ARRAY_LEN(a)
Definition: utils.h:666

References args, ARRAY_LEN, ast_app_separate_args, ast_ari_bridges_add_channel(), ast_ari_bridges_add_channel_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_void(), ast_free, ast_log, ast_malloc, ast_strdup, ast_true(), LOG_ERROR, MAX_VALS, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_add_channel_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 408 of file res_ari_bridges.c.

411{
412 struct ast_json *field;
413 /* Parse query parameters out of it */
414 field = ast_json_object_get(body, "channel");
415 if (field) {
416 /* If they were silly enough to both pass in a query param and a
417 * JSON body, free up the query value.
418 */
419 ast_free(args->channel);
420 if (ast_json_typeof(field) == AST_JSON_ARRAY) {
421 /* Multiple param passed as array */
422 size_t i;
423 args->channel_count = ast_json_array_size(field);
424 args->channel = ast_malloc(sizeof(*args->channel) * args->channel_count);
425
426 if (!args->channel) {
427 return -1;
428 }
429
430 for (i = 0; i < args->channel_count; ++i) {
431 args->channel[i] = ast_json_string_get(ast_json_array_get(field, i));
432 }
433 } else {
434 /* Multiple param passed as single value */
435 args->channel_count = 1;
436 args->channel = ast_malloc(sizeof(*args->channel) * args->channel_count);
437 if (!args->channel) {
438 return -1;
439 }
440 args->channel[0] = ast_json_string_get(field);
441 }
442 }
443 field = ast_json_object_get(body, "role");
444 if (field) {
445 args->role = ast_json_string_get(field);
446 }
447 field = ast_json_object_get(body, "absorbDTMF");
448 if (field) {
449 args->absorb_dtmf = ast_json_is_true(field);
450 }
451 field = ast_json_object_get(body, "mute");
452 if (field) {
453 args->mute = ast_json_is_true(field);
454 }
455 field = ast_json_object_get(body, "inhibitConnectedLineUpdates");
456 if (field) {
457 args->inhibit_connected_line_updates = ast_json_is_true(field);
458 }
459 return 0;
460}
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
Definition: json.c:78
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
Definition: json.c:370
@ AST_JSON_ARRAY
Definition: json.h:165
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:283
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:407
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
Definition: json.c:263
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
Definition: json.c:366
Abstract JSON element (object, array, string, int, ...).

References args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_is_true(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.

Referenced by ast_ari_bridges_add_channel_cb().

◆ ast_ari_bridges_clear_video_source_cb()

static void ast_ari_bridges_clear_video_source_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/videoSource.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 816 of file res_ari_bridges.c.

820{
822 struct ast_variable *i;
823#if defined(AST_DEVMODE)
824 int is_valid;
825 int code;
826#endif /* AST_DEVMODE */
827
828 for (i = path_vars; i; i = i->next) {
829 if (strcmp(i->name, "bridgeId") == 0) {
830 args.bridge_id = (i->value);
831 } else
832 {}
833 }
834 ast_ari_bridges_clear_video_source(headers, &args, response);
835#if defined(AST_DEVMODE)
836 code = response->response_code;
837
838 switch (code) {
839 case 0: /* Implementation is still a stub, or the code wasn't set */
840 is_valid = response->message == NULL;
841 break;
842 case 500: /* Internal Server Error */
843 case 501: /* Not Implemented */
844 case 404: /* Bridge not found */
845 is_valid = 1;
846 break;
847 default:
848 if (200 <= code && code <= 299) {
849 is_valid = ast_ari_validate_void(
850 response->message);
851 } else {
852 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/videoSource\n", code);
853 is_valid = 0;
854 }
855 }
856
857 if (!is_valid) {
858 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/videoSource\n");
859 ast_ari_response_error(response, 500,
860 "Internal Server Error", "Response validation failed");
861 }
862#endif /* AST_DEVMODE */
863
864fin: __attribute__((unused))
865 return;
866}
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...

References args, ast_ari_bridges_clear_video_source(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_create_cb()

static void ast_ari_bridges_create_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 137 of file res_ari_bridges.c.

141{
143 struct ast_variable *i;
144#if defined(AST_DEVMODE)
145 int is_valid;
146 int code;
147#endif /* AST_DEVMODE */
148
149 for (i = get_params; i; i = i->next) {
150 if (strcmp(i->name, "type") == 0) {
151 args.type = (i->value);
152 } else
153 if (strcmp(i->name, "bridgeId") == 0) {
154 args.bridge_id = (i->value);
155 } else
156 if (strcmp(i->name, "name") == 0) {
157 args.name = (i->value);
158 } else
159 {}
160 }
163 goto fin;
164 }
165 ast_ari_bridges_create(headers, &args, response);
166#if defined(AST_DEVMODE)
167 code = response->response_code;
168
169 switch (code) {
170 case 0: /* Implementation is still a stub, or the code wasn't set */
171 is_valid = response->message == NULL;
172 break;
173 case 500: /* Internal Server Error */
174 case 501: /* Not Implemented */
175 case 409: /* Bridge with the same bridgeId already exists */
176 is_valid = 1;
177 break;
178 default:
179 if (200 <= code && code <= 299) {
180 is_valid = ast_ari_validate_bridge(
181 response->message);
182 } else {
183 ast_log(LOG_ERROR, "Invalid error response %d for /bridges\n", code);
184 is_valid = 0;
185 }
186 }
187
188 if (!is_valid) {
189 ast_log(LOG_ERROR, "Response validation failed for /bridges\n");
190 ast_ari_response_error(response, 500,
191 "Internal Server Error", "Response validation failed");
192 }
193#endif /* AST_DEVMODE */
194
195fin: __attribute__((unused))
196 return;
197}
int ast_ari_validate_bridge(struct ast_json *json)
Validator for Bridge.
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_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response)
Create a new bridge.

References args, ast_ari_bridges_create(), ast_ari_bridges_create_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_bridge(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_create_parse_body()

int ast_ari_bridges_create_parse_body ( struct ast_json body,
struct ast_ari_bridges_create_args args 
)

Body parsing function for /bridges.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 107 of file res_ari_bridges.c.

110{
111 struct ast_json *field;
112 /* Parse query parameters out of it */
113 field = ast_json_object_get(body, "type");
114 if (field) {
115 args->type = ast_json_string_get(field);
116 }
117 field = ast_json_object_get(body, "bridgeId");
118 if (field) {
119 args->bridge_id = ast_json_string_get(field);
120 }
121 field = ast_json_object_get(body, "name");
122 if (field) {
123 args->name = ast_json_string_get(field);
124 }
125 return 0;
126}

References args, ast_json_object_get(), and ast_json_string_get().

Referenced by ast_ari_bridges_create_cb().

◆ ast_ari_bridges_create_with_id_cb()

static void ast_ari_bridges_create_with_id_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 224 of file res_ari_bridges.c.

228{
230 struct ast_variable *i;
231#if defined(AST_DEVMODE)
232 int is_valid;
233 int code;
234#endif /* AST_DEVMODE */
235
236 for (i = get_params; i; i = i->next) {
237 if (strcmp(i->name, "type") == 0) {
238 args.type = (i->value);
239 } else
240 if (strcmp(i->name, "name") == 0) {
241 args.name = (i->value);
242 } else
243 {}
244 }
245 for (i = path_vars; i; i = i->next) {
246 if (strcmp(i->name, "bridgeId") == 0) {
247 args.bridge_id = (i->value);
248 } else
249 {}
250 }
253 goto fin;
254 }
255 ast_ari_bridges_create_with_id(headers, &args, response);
256#if defined(AST_DEVMODE)
257 code = response->response_code;
258
259 switch (code) {
260 case 0: /* Implementation is still a stub, or the code wasn't set */
261 is_valid = response->message == NULL;
262 break;
263 case 500: /* Internal Server Error */
264 case 501: /* Not Implemented */
265 case 409: /* Bridge with the same bridgeId already exists */
266 is_valid = 1;
267 break;
268 default:
269 if (200 <= code && code <= 299) {
270 is_valid = ast_ari_validate_bridge(
271 response->message);
272 } else {
273 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}\n", code);
274 is_valid = 0;
275 }
276 }
277
278 if (!is_valid) {
279 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}\n");
280 ast_ari_response_error(response, 500,
281 "Internal Server Error", "Response validation failed");
282 }
283#endif /* AST_DEVMODE */
284
285fin: __attribute__((unused))
286 return;
287}
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}.
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.

References args, ast_ari_bridges_create_with_id(), ast_ari_bridges_create_with_id_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_bridge(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_create_with_id_parse_body()

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}.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 198 of file res_ari_bridges.c.

201{
202 struct ast_json *field;
203 /* Parse query parameters out of it */
204 field = ast_json_object_get(body, "type");
205 if (field) {
206 args->type = ast_json_string_get(field);
207 }
208 field = ast_json_object_get(body, "name");
209 if (field) {
210 args->name = ast_json_string_get(field);
211 }
212 return 0;
213}

References args, ast_json_object_get(), and ast_json_string_get().

Referenced by ast_ari_bridges_create_with_id_cb().

◆ ast_ari_bridges_destroy_cb()

static void ast_ari_bridges_destroy_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 357 of file res_ari_bridges.c.

361{
363 struct ast_variable *i;
364#if defined(AST_DEVMODE)
365 int is_valid;
366 int code;
367#endif /* AST_DEVMODE */
368
369 for (i = path_vars; i; i = i->next) {
370 if (strcmp(i->name, "bridgeId") == 0) {
371 args.bridge_id = (i->value);
372 } else
373 {}
374 }
375 ast_ari_bridges_destroy(headers, &args, response);
376#if defined(AST_DEVMODE)
377 code = response->response_code;
378
379 switch (code) {
380 case 0: /* Implementation is still a stub, or the code wasn't set */
381 is_valid = response->message == NULL;
382 break;
383 case 500: /* Internal Server Error */
384 case 501: /* Not Implemented */
385 case 404: /* Bridge not found */
386 is_valid = 1;
387 break;
388 default:
389 if (200 <= code && code <= 299) {
390 is_valid = ast_ari_validate_void(
391 response->message);
392 } else {
393 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}\n", code);
394 is_valid = 0;
395 }
396 }
397
398 if (!is_valid) {
399 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}\n");
400 ast_ari_response_error(response, 500,
401 "Internal Server Error", "Response validation failed");
402 }
403#endif /* AST_DEVMODE */
404
405fin: __attribute__((unused))
406 return;
407}
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.

References args, ast_ari_bridges_destroy(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_get_cb()

static void ast_ari_bridges_get_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 297 of file res_ari_bridges.c.

301{
302 struct ast_ari_bridges_get_args args = {};
303 struct ast_variable *i;
304#if defined(AST_DEVMODE)
305 int is_valid;
306 int code;
307#endif /* AST_DEVMODE */
308
309 for (i = path_vars; i; i = i->next) {
310 if (strcmp(i->name, "bridgeId") == 0) {
311 args.bridge_id = (i->value);
312 } else
313 {}
314 }
315 ast_ari_bridges_get(headers, &args, response);
316#if defined(AST_DEVMODE)
317 code = response->response_code;
318
319 switch (code) {
320 case 0: /* Implementation is still a stub, or the code wasn't set */
321 is_valid = response->message == NULL;
322 break;
323 case 500: /* Internal Server Error */
324 case 501: /* Not Implemented */
325 case 404: /* Bridge not found */
326 is_valid = 1;
327 break;
328 default:
329 if (200 <= code && code <= 299) {
330 is_valid = ast_ari_validate_bridge(
331 response->message);
332 } else {
333 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}\n", code);
334 is_valid = 0;
335 }
336 }
337
338 if (!is_valid) {
339 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}\n");
340 ast_ari_response_error(response, 500,
341 "Internal Server Error", "Response validation failed");
342 }
343#endif /* AST_DEVMODE */
344
345fin: __attribute__((unused))
346 return;
347}
void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response)
Get bridge details.

References args, ast_ari_bridges_get(), ast_ari_response_error(), ast_ari_validate_bridge(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_list_cb()

static void ast_ari_bridges_list_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 64 of file res_ari_bridges.c.

68{
70#if defined(AST_DEVMODE)
71 int is_valid;
72 int code;
73#endif /* AST_DEVMODE */
74
75 ast_ari_bridges_list(headers, &args, response);
76#if defined(AST_DEVMODE)
77 code = response->response_code;
78
79 switch (code) {
80 case 0: /* Implementation is still a stub, or the code wasn't set */
81 is_valid = response->message == NULL;
82 break;
83 case 500: /* Internal Server Error */
84 case 501: /* Not Implemented */
85 is_valid = 1;
86 break;
87 default:
88 if (200 <= code && code <= 299) {
89 is_valid = ast_ari_validate_list(response->message,
91 } else {
92 ast_log(LOG_ERROR, "Invalid error response %d for /bridges\n", code);
93 is_valid = 0;
94 }
95 }
96
97 if (!is_valid) {
98 ast_log(LOG_ERROR, "Response validation failed for /bridges\n");
99 ast_ari_response_error(response, 500,
100 "Internal Server Error", "Response validation failed");
101 }
102#endif /* AST_DEVMODE */
103
104fin: __attribute__((unused))
105 return;
106}
ari_validator ast_ari_validate_bridge_fn(void)
Function pointer to ast_ari_validate_bridge().
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
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.

References args, ast_ari_bridges_list(), ast_ari_response_error(), ast_ari_validate_bridge_fn(), ast_ari_validate_list(), ast_log, LOG_ERROR, ast_ari_response::message, NULL, and ast_ari_response::response_code.

◆ ast_ari_bridges_play_cb()

static void ast_ari_bridges_play_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/play.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 1075 of file res_ari_bridges.c.

1079{
1080 struct ast_ari_bridges_play_args args = {};
1081 struct ast_variable *i;
1082#if defined(AST_DEVMODE)
1083 int is_valid;
1084 int code;
1085#endif /* AST_DEVMODE */
1086
1087 for (i = get_params; i; i = i->next) {
1088 if (strcmp(i->name, "media") == 0) {
1089 /* Parse comma separated list */
1090 char *vals[MAX_VALS];
1091 size_t j;
1092
1093 args.media_parse = ast_strdup(i->value);
1094 if (!args.media_parse) {
1096 goto fin;
1097 }
1098
1099 if (strlen(args.media_parse) == 0) {
1100 /* ast_app_separate_args can't handle "" */
1101 args.media_count = 1;
1102 vals[0] = args.media_parse;
1103 } else {
1104 args.media_count = ast_app_separate_args(
1105 args.media_parse, ',', vals,
1106 ARRAY_LEN(vals));
1107 }
1108
1109 if (args.media_count == 0) {
1111 goto fin;
1112 }
1113
1114 if (args.media_count >= MAX_VALS) {
1115 ast_ari_response_error(response, 400,
1116 "Bad Request",
1117 "Too many values for media");
1118 goto fin;
1119 }
1120
1121 args.media = ast_malloc(sizeof(*args.media) * args.media_count);
1122 if (!args.media) {
1124 goto fin;
1125 }
1126
1127 for (j = 0; j < args.media_count; ++j) {
1128 args.media[j] = (vals[j]);
1129 }
1130 } else
1131 if (strcmp(i->name, "lang") == 0) {
1132 args.lang = (i->value);
1133 } else
1134 if (strcmp(i->name, "offsetms") == 0) {
1135 args.offsetms = atoi(i->value);
1136 } else
1137 if (strcmp(i->name, "skipms") == 0) {
1138 args.skipms = atoi(i->value);
1139 } else
1140 if (strcmp(i->name, "playbackId") == 0) {
1141 args.playback_id = (i->value);
1142 } else
1143 {}
1144 }
1145 for (i = path_vars; i; i = i->next) {
1146 if (strcmp(i->name, "bridgeId") == 0) {
1147 args.bridge_id = (i->value);
1148 } else
1149 {}
1150 }
1153 goto fin;
1154 }
1155 ast_ari_bridges_play(headers, &args, response);
1156#if defined(AST_DEVMODE)
1157 code = response->response_code;
1158
1159 switch (code) {
1160 case 0: /* Implementation is still a stub, or the code wasn't set */
1161 is_valid = response->message == NULL;
1162 break;
1163 case 500: /* Internal Server Error */
1164 case 501: /* Not Implemented */
1165 case 404: /* Bridge not found */
1166 case 409: /* Bridge not in a Stasis application */
1167 is_valid = 1;
1168 break;
1169 default:
1170 if (200 <= code && code <= 299) {
1171 is_valid = ast_ari_validate_playback(
1172 response->message);
1173 } else {
1174 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/play\n", code);
1175 is_valid = 0;
1176 }
1177 }
1178
1179 if (!is_valid) {
1180 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/play\n");
1181 ast_ari_response_error(response, 500,
1182 "Internal Server Error", "Response validation failed");
1183 }
1184#endif /* AST_DEVMODE */
1185
1186fin: __attribute__((unused))
1187 ast_free(args.media_parse);
1188 ast_free(args.media);
1189 return;
1190}
int ast_ari_validate_playback(struct ast_json *json)
Validator for Playback.
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.
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.

References args, ARRAY_LEN, ast_app_separate_args, ast_ari_bridges_play(), ast_ari_bridges_play_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_playback(), ast_free, ast_log, ast_malloc, ast_strdup, LOG_ERROR, MAX_VALS, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_play_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 1012 of file res_ari_bridges.c.

1015{
1016 struct ast_json *field;
1017 /* Parse query parameters out of it */
1018 field = ast_json_object_get(body, "media");
1019 if (field) {
1020 /* If they were silly enough to both pass in a query param and a
1021 * JSON body, free up the query value.
1022 */
1023 ast_free(args->media);
1024 if (ast_json_typeof(field) == AST_JSON_ARRAY) {
1025 /* Multiple param passed as array */
1026 size_t i;
1027 args->media_count = ast_json_array_size(field);
1028 args->media = ast_malloc(sizeof(*args->media) * args->media_count);
1029
1030 if (!args->media) {
1031 return -1;
1032 }
1033
1034 for (i = 0; i < args->media_count; ++i) {
1035 args->media[i] = ast_json_string_get(ast_json_array_get(field, i));
1036 }
1037 } else {
1038 /* Multiple param passed as single value */
1039 args->media_count = 1;
1040 args->media = ast_malloc(sizeof(*args->media) * args->media_count);
1041 if (!args->media) {
1042 return -1;
1043 }
1044 args->media[0] = ast_json_string_get(field);
1045 }
1046 }
1047 field = ast_json_object_get(body, "lang");
1048 if (field) {
1049 args->lang = ast_json_string_get(field);
1050 }
1051 field = ast_json_object_get(body, "offsetms");
1052 if (field) {
1053 args->offsetms = ast_json_integer_get(field);
1054 }
1055 field = ast_json_object_get(body, "skipms");
1056 if (field) {
1057 args->skipms = ast_json_integer_get(field);
1058 }
1059 field = ast_json_object_get(body, "playbackId");
1060 if (field) {
1061 args->playback_id = ast_json_string_get(field);
1062 }
1063 return 0;
1064}
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
Definition: json.c:332

References args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.

Referenced by ast_ari_bridges_play_cb().

◆ ast_ari_bridges_play_with_id_cb()

static void ast_ari_bridges_play_with_id_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/play/{playbackId}.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 1250 of file res_ari_bridges.c.

1254{
1256 struct ast_variable *i;
1257#if defined(AST_DEVMODE)
1258 int is_valid;
1259 int code;
1260#endif /* AST_DEVMODE */
1261
1262 for (i = get_params; i; i = i->next) {
1263 if (strcmp(i->name, "media") == 0) {
1264 /* Parse comma separated list */
1265 char *vals[MAX_VALS];
1266 size_t j;
1267
1268 args.media_parse = ast_strdup(i->value);
1269 if (!args.media_parse) {
1271 goto fin;
1272 }
1273
1274 if (strlen(args.media_parse) == 0) {
1275 /* ast_app_separate_args can't handle "" */
1276 args.media_count = 1;
1277 vals[0] = args.media_parse;
1278 } else {
1279 args.media_count = ast_app_separate_args(
1280 args.media_parse, ',', vals,
1281 ARRAY_LEN(vals));
1282 }
1283
1284 if (args.media_count == 0) {
1286 goto fin;
1287 }
1288
1289 if (args.media_count >= MAX_VALS) {
1290 ast_ari_response_error(response, 400,
1291 "Bad Request",
1292 "Too many values for media");
1293 goto fin;
1294 }
1295
1296 args.media = ast_malloc(sizeof(*args.media) * args.media_count);
1297 if (!args.media) {
1299 goto fin;
1300 }
1301
1302 for (j = 0; j < args.media_count; ++j) {
1303 args.media[j] = (vals[j]);
1304 }
1305 } else
1306 if (strcmp(i->name, "lang") == 0) {
1307 args.lang = (i->value);
1308 } else
1309 if (strcmp(i->name, "offsetms") == 0) {
1310 args.offsetms = atoi(i->value);
1311 } else
1312 if (strcmp(i->name, "skipms") == 0) {
1313 args.skipms = atoi(i->value);
1314 } else
1315 {}
1316 }
1317 for (i = path_vars; i; i = i->next) {
1318 if (strcmp(i->name, "bridgeId") == 0) {
1319 args.bridge_id = (i->value);
1320 } else
1321 if (strcmp(i->name, "playbackId") == 0) {
1322 args.playback_id = (i->value);
1323 } else
1324 {}
1325 }
1328 goto fin;
1329 }
1330 ast_ari_bridges_play_with_id(headers, &args, response);
1331#if defined(AST_DEVMODE)
1332 code = response->response_code;
1333
1334 switch (code) {
1335 case 0: /* Implementation is still a stub, or the code wasn't set */
1336 is_valid = response->message == NULL;
1337 break;
1338 case 500: /* Internal Server Error */
1339 case 501: /* Not Implemented */
1340 case 404: /* Bridge not found */
1341 case 409: /* Bridge not in a Stasis application */
1342 is_valid = 1;
1343 break;
1344 default:
1345 if (200 <= code && code <= 299) {
1346 is_valid = ast_ari_validate_playback(
1347 response->message);
1348 } else {
1349 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/play/{playbackId}\n", code);
1350 is_valid = 0;
1351 }
1352 }
1353
1354 if (!is_valid) {
1355 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/play/{playbackId}\n");
1356 ast_ari_response_error(response, 500,
1357 "Internal Server Error", "Response validation failed");
1358 }
1359#endif /* AST_DEVMODE */
1360
1361fin: __attribute__((unused))
1362 ast_free(args.media_parse);
1363 ast_free(args.media);
1364 return;
1365}
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}.
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.

References args, ARRAY_LEN, ast_app_separate_args, ast_ari_bridges_play_with_id(), ast_ari_bridges_play_with_id_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_playback(), ast_free, ast_log, ast_malloc, ast_strdup, LOG_ERROR, MAX_VALS, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_play_with_id_parse_body()

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}.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 1191 of file res_ari_bridges.c.

1194{
1195 struct ast_json *field;
1196 /* Parse query parameters out of it */
1197 field = ast_json_object_get(body, "media");
1198 if (field) {
1199 /* If they were silly enough to both pass in a query param and a
1200 * JSON body, free up the query value.
1201 */
1202 ast_free(args->media);
1203 if (ast_json_typeof(field) == AST_JSON_ARRAY) {
1204 /* Multiple param passed as array */
1205 size_t i;
1206 args->media_count = ast_json_array_size(field);
1207 args->media = ast_malloc(sizeof(*args->media) * args->media_count);
1208
1209 if (!args->media) {
1210 return -1;
1211 }
1212
1213 for (i = 0; i < args->media_count; ++i) {
1214 args->media[i] = ast_json_string_get(ast_json_array_get(field, i));
1215 }
1216 } else {
1217 /* Multiple param passed as single value */
1218 args->media_count = 1;
1219 args->media = ast_malloc(sizeof(*args->media) * args->media_count);
1220 if (!args->media) {
1221 return -1;
1222 }
1223 args->media[0] = ast_json_string_get(field);
1224 }
1225 }
1226 field = ast_json_object_get(body, "lang");
1227 if (field) {
1228 args->lang = ast_json_string_get(field);
1229 }
1230 field = ast_json_object_get(body, "offsetms");
1231 if (field) {
1232 args->offsetms = ast_json_integer_get(field);
1233 }
1234 field = ast_json_object_get(body, "skipms");
1235 if (field) {
1236 args->skipms = ast_json_integer_get(field);
1237 }
1238 return 0;
1239}

References args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.

Referenced by ast_ari_bridges_play_with_id_cb().

◆ ast_ari_bridges_record_cb()

static void ast_ari_bridges_record_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/record.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 1412 of file res_ari_bridges.c.

1416{
1418 struct ast_variable *i;
1419#if defined(AST_DEVMODE)
1420 int is_valid;
1421 int code;
1422#endif /* AST_DEVMODE */
1423
1424 for (i = get_params; i; i = i->next) {
1425 if (strcmp(i->name, "name") == 0) {
1426 args.name = (i->value);
1427 } else
1428 if (strcmp(i->name, "format") == 0) {
1429 args.format = (i->value);
1430 } else
1431 if (strcmp(i->name, "maxDurationSeconds") == 0) {
1432 args.max_duration_seconds = atoi(i->value);
1433 } else
1434 if (strcmp(i->name, "maxSilenceSeconds") == 0) {
1435 args.max_silence_seconds = atoi(i->value);
1436 } else
1437 if (strcmp(i->name, "ifExists") == 0) {
1438 args.if_exists = (i->value);
1439 } else
1440 if (strcmp(i->name, "beep") == 0) {
1441 args.beep = ast_true(i->value);
1442 } else
1443 if (strcmp(i->name, "terminateOn") == 0) {
1444 args.terminate_on = (i->value);
1445 } else
1446 {}
1447 }
1448 for (i = path_vars; i; i = i->next) {
1449 if (strcmp(i->name, "bridgeId") == 0) {
1450 args.bridge_id = (i->value);
1451 } else
1452 {}
1453 }
1456 goto fin;
1457 }
1458 ast_ari_bridges_record(headers, &args, response);
1459#if defined(AST_DEVMODE)
1460 code = response->response_code;
1461
1462 switch (code) {
1463 case 0: /* Implementation is still a stub, or the code wasn't set */
1464 is_valid = response->message == NULL;
1465 break;
1466 case 500: /* Internal Server Error */
1467 case 501: /* Not Implemented */
1468 case 400: /* Invalid parameters */
1469 case 404: /* Bridge not found */
1470 case 409: /* Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail */
1471 case 422: /* The format specified is unknown on this system */
1472 is_valid = 1;
1473 break;
1474 default:
1475 if (200 <= code && code <= 299) {
1477 response->message);
1478 } else {
1479 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/record\n", code);
1480 is_valid = 0;
1481 }
1482 }
1483
1484 if (!is_valid) {
1485 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/record\n");
1486 ast_ari_response_error(response, 500,
1487 "Internal Server Error", "Response validation failed");
1488 }
1489#endif /* AST_DEVMODE */
1490
1491fin: __attribute__((unused))
1492 return;
1493}
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
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.
void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response)
Start a recording.

References args, ast_ari_bridges_record(), ast_ari_bridges_record_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_live_recording(), ast_log, ast_true(), LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_record_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 1366 of file res_ari_bridges.c.

1369{
1370 struct ast_json *field;
1371 /* Parse query parameters out of it */
1372 field = ast_json_object_get(body, "name");
1373 if (field) {
1374 args->name = ast_json_string_get(field);
1375 }
1376 field = ast_json_object_get(body, "format");
1377 if (field) {
1378 args->format = ast_json_string_get(field);
1379 }
1380 field = ast_json_object_get(body, "maxDurationSeconds");
1381 if (field) {
1382 args->max_duration_seconds = ast_json_integer_get(field);
1383 }
1384 field = ast_json_object_get(body, "maxSilenceSeconds");
1385 if (field) {
1386 args->max_silence_seconds = ast_json_integer_get(field);
1387 }
1388 field = ast_json_object_get(body, "ifExists");
1389 if (field) {
1390 args->if_exists = ast_json_string_get(field);
1391 }
1392 field = ast_json_object_get(body, "beep");
1393 if (field) {
1394 args->beep = ast_json_is_true(field);
1395 }
1396 field = ast_json_object_get(body, "terminateOn");
1397 if (field) {
1398 args->terminate_on = ast_json_string_get(field);
1399 }
1400 return 0;
1401}

References args, ast_json_integer_get(), ast_json_is_true(), ast_json_object_get(), and ast_json_string_get().

Referenced by ast_ari_bridges_record_cb().

◆ ast_ari_bridges_remove_channel_cb()

static void ast_ari_bridges_remove_channel_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/removeChannel.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 636 of file res_ari_bridges.c.

640{
642 struct ast_variable *i;
643#if defined(AST_DEVMODE)
644 int is_valid;
645 int code;
646#endif /* AST_DEVMODE */
647
648 for (i = get_params; i; i = i->next) {
649 if (strcmp(i->name, "channel") == 0) {
650 /* Parse comma separated list */
651 char *vals[MAX_VALS];
652 size_t j;
653
654 args.channel_parse = ast_strdup(i->value);
655 if (!args.channel_parse) {
657 goto fin;
658 }
659
660 if (strlen(args.channel_parse) == 0) {
661 /* ast_app_separate_args can't handle "" */
662 args.channel_count = 1;
663 vals[0] = args.channel_parse;
664 } else {
665 args.channel_count = ast_app_separate_args(
666 args.channel_parse, ',', vals,
667 ARRAY_LEN(vals));
668 }
669
670 if (args.channel_count == 0) {
672 goto fin;
673 }
674
675 if (args.channel_count >= MAX_VALS) {
676 ast_ari_response_error(response, 400,
677 "Bad Request",
678 "Too many values for channel");
679 goto fin;
680 }
681
682 args.channel = ast_malloc(sizeof(*args.channel) * args.channel_count);
683 if (!args.channel) {
685 goto fin;
686 }
687
688 for (j = 0; j < args.channel_count; ++j) {
689 args.channel[j] = (vals[j]);
690 }
691 } else
692 {}
693 }
694 for (i = path_vars; i; i = i->next) {
695 if (strcmp(i->name, "bridgeId") == 0) {
696 args.bridge_id = (i->value);
697 } else
698 {}
699 }
702 goto fin;
703 }
704 ast_ari_bridges_remove_channel(headers, &args, response);
705#if defined(AST_DEVMODE)
706 code = response->response_code;
707
708 switch (code) {
709 case 0: /* Implementation is still a stub, or the code wasn't set */
710 is_valid = response->message == NULL;
711 break;
712 case 500: /* Internal Server Error */
713 case 501: /* Not Implemented */
714 case 400: /* Channel not found */
715 case 404: /* Bridge not found */
716 case 409: /* Bridge not in Stasis application */
717 case 422: /* Channel not in this bridge */
718 is_valid = 1;
719 break;
720 default:
721 if (200 <= code && code <= 299) {
722 is_valid = ast_ari_validate_void(
723 response->message);
724 } else {
725 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/removeChannel\n", code);
726 is_valid = 0;
727 }
728 }
729
730 if (!is_valid) {
731 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/removeChannel\n");
732 ast_ari_response_error(response, 500,
733 "Internal Server Error", "Response validation failed");
734 }
735#endif /* AST_DEVMODE */
736
737fin: __attribute__((unused))
738 ast_free(args.channel_parse);
739 ast_free(args.channel);
740 return;
741}
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.
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.

References args, ARRAY_LEN, ast_app_separate_args, ast_ari_bridges_remove_channel(), ast_ari_bridges_remove_channel_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_void(), ast_free, ast_log, ast_malloc, ast_strdup, LOG_ERROR, MAX_VALS, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_remove_channel_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 589 of file res_ari_bridges.c.

592{
593 struct ast_json *field;
594 /* Parse query parameters out of it */
595 field = ast_json_object_get(body, "channel");
596 if (field) {
597 /* If they were silly enough to both pass in a query param and a
598 * JSON body, free up the query value.
599 */
600 ast_free(args->channel);
601 if (ast_json_typeof(field) == AST_JSON_ARRAY) {
602 /* Multiple param passed as array */
603 size_t i;
604 args->channel_count = ast_json_array_size(field);
605 args->channel = ast_malloc(sizeof(*args->channel) * args->channel_count);
606
607 if (!args->channel) {
608 return -1;
609 }
610
611 for (i = 0; i < args->channel_count; ++i) {
612 args->channel[i] = ast_json_string_get(ast_json_array_get(field, i));
613 }
614 } else {
615 /* Multiple param passed as single value */
616 args->channel_count = 1;
617 args->channel = ast_malloc(sizeof(*args->channel) * args->channel_count);
618 if (!args->channel) {
619 return -1;
620 }
621 args->channel[0] = ast_json_string_get(field);
622 }
623 }
624 return 0;
625}

References args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.

Referenced by ast_ari_bridges_remove_channel_cb().

◆ ast_ari_bridges_set_video_source_cb()

static void ast_ari_bridges_set_video_source_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/videoSource/{channelId}.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 751 of file res_ari_bridges.c.

755{
757 struct ast_variable *i;
758#if defined(AST_DEVMODE)
759 int is_valid;
760 int code;
761#endif /* AST_DEVMODE */
762
763 for (i = path_vars; i; i = i->next) {
764 if (strcmp(i->name, "bridgeId") == 0) {
765 args.bridge_id = (i->value);
766 } else
767 if (strcmp(i->name, "channelId") == 0) {
768 args.channel_id = (i->value);
769 } else
770 {}
771 }
772 ast_ari_bridges_set_video_source(headers, &args, response);
773#if defined(AST_DEVMODE)
774 code = response->response_code;
775
776 switch (code) {
777 case 0: /* Implementation is still a stub, or the code wasn't set */
778 is_valid = response->message == NULL;
779 break;
780 case 500: /* Internal Server Error */
781 case 501: /* Not Implemented */
782 case 404: /* Bridge or Channel not found */
783 case 409: /* Channel not in Stasis application */
784 case 422: /* Channel not in this Bridge */
785 is_valid = 1;
786 break;
787 default:
788 if (200 <= code && code <= 299) {
789 is_valid = ast_ari_validate_void(
790 response->message);
791 } else {
792 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/videoSource/{channelId}\n", code);
793 is_valid = 0;
794 }
795 }
796
797 if (!is_valid) {
798 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/videoSource/{channelId}\n");
799 ast_ari_response_error(response, 500,
800 "Internal Server Error", "Response validation failed");
801 }
802#endif /* AST_DEVMODE */
803
804fin: __attribute__((unused))
805 return;
806}
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...

References args, ast_ari_bridges_set_video_source(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_start_moh_cb()

static void ast_ari_bridges_start_moh_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/moh.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 889 of file res_ari_bridges.c.

893{
895 struct ast_variable *i;
896#if defined(AST_DEVMODE)
897 int is_valid;
898 int code;
899#endif /* AST_DEVMODE */
900
901 for (i = get_params; i; i = i->next) {
902 if (strcmp(i->name, "mohClass") == 0) {
903 args.moh_class = (i->value);
904 } else
905 {}
906 }
907 for (i = path_vars; i; i = i->next) {
908 if (strcmp(i->name, "bridgeId") == 0) {
909 args.bridge_id = (i->value);
910 } else
911 {}
912 }
915 goto fin;
916 }
917 ast_ari_bridges_start_moh(headers, &args, response);
918#if defined(AST_DEVMODE)
919 code = response->response_code;
920
921 switch (code) {
922 case 0: /* Implementation is still a stub, or the code wasn't set */
923 is_valid = response->message == NULL;
924 break;
925 case 500: /* Internal Server Error */
926 case 501: /* Not Implemented */
927 case 404: /* Bridge not found */
928 case 409: /* Bridge not in Stasis application */
929 is_valid = 1;
930 break;
931 default:
932 if (200 <= code && code <= 299) {
933 is_valid = ast_ari_validate_void(
934 response->message);
935 } else {
936 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/moh\n", code);
937 is_valid = 0;
938 }
939 }
940
941 if (!is_valid) {
942 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/moh\n");
943 ast_ari_response_error(response, 500,
944 "Internal Server Error", "Response validation failed");
945 }
946#endif /* AST_DEVMODE */
947
948fin: __attribute__((unused))
949 return;
950}
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_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.

References args, ast_ari_bridges_start_moh(), ast_ari_bridges_start_moh_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ ast_ari_bridges_start_moh_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 867 of file res_ari_bridges.c.

870{
871 struct ast_json *field;
872 /* Parse query parameters out of it */
873 field = ast_json_object_get(body, "mohClass");
874 if (field) {
875 args->moh_class = ast_json_string_get(field);
876 }
877 return 0;
878}

References args, ast_json_object_get(), and ast_json_string_get().

Referenced by ast_ari_bridges_start_moh_cb().

◆ ast_ari_bridges_stop_moh_cb()

static void ast_ari_bridges_stop_moh_cb ( struct ast_tcptls_session_instance ser,
struct ast_variable get_params,
struct ast_variable path_vars,
struct ast_variable headers,
struct ast_json body,
struct ast_ari_response response 
)
static

Parameter parsing callback for /bridges/{bridgeId}/moh.

Parameters
serTCP/TLS session object
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
body
[out]responseResponse to the HTTP request.

Definition at line 960 of file res_ari_bridges.c.

964{
966 struct ast_variable *i;
967#if defined(AST_DEVMODE)
968 int is_valid;
969 int code;
970#endif /* AST_DEVMODE */
971
972 for (i = path_vars; i; i = i->next) {
973 if (strcmp(i->name, "bridgeId") == 0) {
974 args.bridge_id = (i->value);
975 } else
976 {}
977 }
978 ast_ari_bridges_stop_moh(headers, &args, response);
979#if defined(AST_DEVMODE)
980 code = response->response_code;
981
982 switch (code) {
983 case 0: /* Implementation is still a stub, or the code wasn't set */
984 is_valid = response->message == NULL;
985 break;
986 case 500: /* Internal Server Error */
987 case 501: /* Not Implemented */
988 case 404: /* Bridge not found */
989 case 409: /* Bridge not in Stasis application */
990 is_valid = 1;
991 break;
992 default:
993 if (200 <= code && code <= 299) {
994 is_valid = ast_ari_validate_void(
995 response->message);
996 } else {
997 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/moh\n", code);
998 is_valid = 0;
999 }
1000 }
1001
1002 if (!is_valid) {
1003 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/moh\n");
1004 ast_ari_response_error(response, 500,
1005 "Internal Server Error", "Response validation failed");
1006 }
1007#endif /* AST_DEVMODE */
1008
1009fin: __attribute__((unused))
1010 return;
1011}
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.

References args, ast_ari_bridges_stop_moh(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

◆ AST_MODULE_SELF_SYM()

struct ast_module * AST_MODULE_SELF_SYM ( void  )

Definition at line 1618 of file res_ari_bridges.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 1599 of file res_ari_bridges.c.

1600{
1601 int res = 0;
1602
1603
1605 if (res) {
1606 unload_module();
1608 }
1609
1611}
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:239
@ AST_MODULE_LOAD_SUCCESS
Definition: module.h:70
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
static int unload_module(void)
static struct stasis_rest_handlers bridges
REST handler for /api-docs/bridges.json.

References ast_ari_add_handler(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, bridges, and unload_module().

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 1593 of file res_ari_bridges.c.

1594{
1596 return 0;
1597}
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:262

References ast_ari_remove_handler(), and bridges.

Referenced by load_module().

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "RESTful API module - Bridge resources" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari,res_ari_model,res_stasis,res_stasis_recording,res_stasis_playback", }
static

Definition at line 1618 of file res_ari_bridges.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 1618 of file res_ari_bridges.c.

◆ bridges

struct stasis_rest_handlers bridges
static

REST handler for /api-docs/bridges.json.

Definition at line 1583 of file res_ari_bridges.c.

Referenced by load_module(), and unload_module().

◆ bridges_bridgeId

struct stasis_rest_handlers bridges_bridgeId
static

REST handler for /api-docs/bridges.json.

Definition at line 1571 of file res_ari_bridges.c.

◆ bridges_bridgeId_addChannel

struct stasis_rest_handlers bridges_bridgeId_addChannel
static

REST handler for /api-docs/bridges.json.

Definition at line 1496 of file res_ari_bridges.c.

◆ bridges_bridgeId_moh

struct stasis_rest_handlers bridges_bridgeId_moh
static

REST handler for /api-docs/bridges.json.

Definition at line 1533 of file res_ari_bridges.c.

◆ bridges_bridgeId_play

struct stasis_rest_handlers bridges_bridgeId_play
static

REST handler for /api-docs/bridges.json.

Definition at line 1553 of file res_ari_bridges.c.

◆ bridges_bridgeId_play_playbackId

struct stasis_rest_handlers bridges_bridgeId_play_playbackId
static

REST handler for /api-docs/bridges.json.

Definition at line 1543 of file res_ari_bridges.c.

◆ bridges_bridgeId_record

struct stasis_rest_handlers bridges_bridgeId_record
static

REST handler for /api-docs/bridges.json.

Definition at line 1562 of file res_ari_bridges.c.

◆ bridges_bridgeId_removeChannel

struct stasis_rest_handlers bridges_bridgeId_removeChannel
static

REST handler for /api-docs/bridges.json.

Definition at line 1505 of file res_ari_bridges.c.

◆ bridges_bridgeId_videoSource

struct stasis_rest_handlers bridges_bridgeId_videoSource
static

REST handler for /api-docs/bridges.json.

Definition at line 1524 of file res_ari_bridges.c.

◆ bridges_bridgeId_videoSource_channelId

struct stasis_rest_handlers bridges_bridgeId_videoSource_channelId
static

REST handler for /api-docs/bridges.json.

Definition at line 1514 of file res_ari_bridges.c.