Asterisk - The Open Source Telephony Project GIT-master-2de1a68
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 1616 of file res_ari_bridges.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 1616 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 469 of file res_ari_bridges.c.

473{
475 struct ast_variable *i;
476#if defined(AST_DEVMODE)
477 int is_valid;
478 int code;
479#endif /* AST_DEVMODE */
480
481 for (i = get_params; i; i = i->next) {
482 if (strcmp(i->name, "channel") == 0) {
483 /* Parse comma separated list */
484 char *vals[MAX_VALS];
485 size_t j;
486
487 args.channel_parse = ast_strdup(i->value);
488 if (!args.channel_parse) {
490 goto fin;
491 }
492
493 if (strlen(args.channel_parse) == 0) {
494 /* ast_app_separate_args can't handle "" */
495 args.channel_count = 1;
496 vals[0] = args.channel_parse;
497 } else {
498 args.channel_count = ast_app_separate_args(
499 args.channel_parse, ',', vals,
500 ARRAY_LEN(vals));
501 }
502
503 if (args.channel_count == 0) {
505 goto fin;
506 }
507
508 if (args.channel_count >= MAX_VALS) {
509 ast_ari_response_error(response, 400,
510 "Bad Request",
511 "Too many values for channel");
512 goto fin;
513 }
514
515 args.channel = ast_malloc(sizeof(*args.channel) * args.channel_count);
516 if (!args.channel) {
518 goto fin;
519 }
520
521 for (j = 0; j < args.channel_count; ++j) {
522 args.channel[j] = (vals[j]);
523 }
524 } else
525 if (strcmp(i->name, "role") == 0) {
526 args.role = (i->value);
527 } else
528 if (strcmp(i->name, "absorbDTMF") == 0) {
529 args.absorb_dtmf = ast_true(i->value);
530 } else
531 if (strcmp(i->name, "mute") == 0) {
532 args.mute = ast_true(i->value);
533 } else
534 if (strcmp(i->name, "inhibitConnectedLineUpdates") == 0) {
535 args.inhibit_connected_line_updates = ast_true(i->value);
536 } else
537 {}
538 }
539 for (i = path_vars; i; i = i->next) {
540 if (strcmp(i->name, "bridgeId") == 0) {
541 args.bridge_id = (i->value);
542 } else
543 {}
544 }
547 goto fin;
548 }
549 ast_ari_bridges_add_channel(headers, &args, response);
550#if defined(AST_DEVMODE)
551 code = response->response_code;
552
553 switch (code) {
554 case 0: /* Implementation is still a stub, or the code wasn't set */
555 is_valid = response->message == NULL;
556 break;
557 case 500: /* Internal Server Error */
558 case 501: /* Not Implemented */
559 case 400: /* Channel not found */
560 case 404: /* Bridge not found */
561 case 409: /* Bridge not in Stasis application; Channel currently recording */
562 case 422: /* Channel not in Stasis application */
563 is_valid = 1;
564 break;
565 default:
566 if (200 <= code && code <= 299) {
567 is_valid = ast_ari_validate_void(
568 response->message);
569 } else {
570 ast_log(LOG_ERROR, "Invalid error response %d for /bridges/{bridgeId}/addChannel\n", code);
571 is_valid = 0;
572 }
573 }
574
575 if (!is_valid) {
576 ast_log(LOG_ERROR, "Response validation failed for /bridges/{bridgeId}/addChannel\n");
577 ast_ari_response_error(response, 500,
578 "Internal Server Error", "Response validation failed");
579 }
580#endif /* AST_DEVMODE */
581
582fin: __attribute__((unused))
583 ast_free(args.channel_parse);
584 ast_free(args.channel);
585 return;
586}
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:259
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:298
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:94
int response_code
Definition: ari.h:99
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 406 of file res_ari_bridges.c.

409{
410 struct ast_json *field;
411 /* Parse query parameters out of it */
412 field = ast_json_object_get(body, "channel");
413 if (field) {
414 /* If they were silly enough to both pass in a query param and a
415 * JSON body, free up the query value.
416 */
417 ast_free(args->channel);
418 if (ast_json_typeof(field) == AST_JSON_ARRAY) {
419 /* Multiple param passed as array */
420 size_t i;
421 args->channel_count = ast_json_array_size(field);
422 args->channel = ast_malloc(sizeof(*args->channel) * args->channel_count);
423
424 if (!args->channel) {
425 return -1;
426 }
427
428 for (i = 0; i < args->channel_count; ++i) {
429 args->channel[i] = ast_json_string_get(ast_json_array_get(field, i));
430 }
431 } else {
432 /* Multiple param passed as single value */
433 args->channel_count = 1;
434 args->channel = ast_malloc(sizeof(*args->channel) * args->channel_count);
435 if (!args->channel) {
436 return -1;
437 }
438 args->channel[0] = ast_json_string_get(field);
439 }
440 }
441 field = ast_json_object_get(body, "role");
442 if (field) {
443 args->role = ast_json_string_get(field);
444 }
445 field = ast_json_object_get(body, "absorbDTMF");
446 if (field) {
447 args->absorb_dtmf = ast_json_is_true(field);
448 }
449 field = ast_json_object_get(body, "mute");
450 if (field) {
451 args->mute = ast_json_is_true(field);
452 }
453 field = ast_json_object_get(body, "inhibitConnectedLineUpdates");
454 if (field) {
455 args->inhibit_connected_line_updates = ast_json_is_true(field);
456 }
457 return 0;
458}
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 814 of file res_ari_bridges.c.

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

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

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 197 of file res_ari_bridges.c.

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

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 355 of file res_ari_bridges.c.

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

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

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

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

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

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

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 1410 of file res_ari_bridges.c.

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

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

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 634 of file res_ari_bridges.c.

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

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

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 749 of file res_ari_bridges.c.

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

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

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

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 958 of file res_ari_bridges.c.

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

◆ load_module()

static int load_module ( void  )
static

Definition at line 1597 of file res_ari_bridges.c.

1598{
1599 int res = 0;
1600
1601
1603 if (res) {
1604 unload_module();
1606 }
1607
1609}
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:179
@ 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 1591 of file res_ari_bridges.c.

1592{
1594 return 0;
1595}
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:202

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 1616 of file res_ari_bridges.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 1616 of file res_ari_bridges.c.

◆ bridges

struct stasis_rest_handlers bridges
static

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

Definition at line 1581 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 1569 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 1494 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 1531 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 1551 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 1541 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 1560 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 1503 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 1522 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 1512 of file res_ari_bridges.c.