Asterisk - The Open Source Telephony Project  GIT-master-a1fa8df
Macros | Functions | Variables
res_ari_endpoints.c File Reference

Endpoint resources. More...

#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app.h"
#include "ari/resource_endpoints.h"

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_endpoints_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 /endpoints/{tech}/{resource}. More...
 
static void ast_ari_endpoints_list_by_tech_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 /endpoints/{tech}. More...
 
static void ast_ari_endpoints_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 /endpoints. More...
 
static void ast_ari_endpoints_send_message_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 /endpoints/sendMessage. More...
 
int ast_ari_endpoints_send_message_parse_body (struct ast_json *body, struct ast_ari_endpoints_send_message_args *args)
 Body parsing function for /endpoints/sendMessage. More...
 
static void ast_ari_endpoints_send_message_to_endpoint_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 /endpoints/{tech}/{resource}/sendMessage. More...
 
int ast_ari_endpoints_send_message_to_endpoint_parse_body (struct ast_json *body, struct ast_ari_endpoints_send_message_to_endpoint_args *args)
 Body parsing function for /endpoints/{tech}/{resource}/sendMessage. 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 - Endpoint 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", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct stasis_rest_handlers endpoints
 REST handler for /api-docs/endpoints.json. More...
 
static struct stasis_rest_handlers endpoints_sendMessage
 REST handler for /api-docs/endpoints.json. More...
 
static struct stasis_rest_handlers endpoints_tech
 REST handler for /api-docs/endpoints.json. More...
 
static struct stasis_rest_handlers endpoints_tech_resource
 REST handler for /api-docs/endpoints.json. More...
 
static struct stasis_rest_handlers endpoints_tech_resource_sendMessage
 REST handler for /api-docs/endpoints.json. More...
 

Detailed Description

Endpoint resources.

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

Definition in file res_ari_endpoints.c.

Macro Definition Documentation

◆ MAX_VALS

#define MAX_VALS   128

Definition at line 51 of file res_ari_endpoints.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 473 of file res_ari_endpoints.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 473 of file res_ari_endpoints.c.

◆ ast_ari_endpoints_get_cb()

static void ast_ari_endpoints_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 /endpoints/{tech}/{resource}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 255 of file res_ari_endpoints.c.

References ast_ari_endpoints_get(), ast_ari_response_error(), ast_ari_validate_endpoint(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_endpoints_get_args::resource, ast_ari_response::response_code, ast_ari_endpoints_get_args::tech, and ast_variable::value.

259 {
260  struct ast_ari_endpoints_get_args args = {};
261  struct ast_variable *i;
262 #if defined(AST_DEVMODE)
263  int is_valid;
264  int code;
265 #endif /* AST_DEVMODE */
266 
267  for (i = path_vars; i; i = i->next) {
268  if (strcmp(i->name, "tech") == 0) {
269  args.tech = (i->value);
270  } else
271  if (strcmp(i->name, "resource") == 0) {
272  args.resource = (i->value);
273  } else
274  {}
275  }
276  ast_ari_endpoints_get(headers, &args, response);
277 #if defined(AST_DEVMODE)
278  code = response->response_code;
279 
280  switch (code) {
281  case 0: /* Implementation is still a stub, or the code wasn't set */
282  is_valid = response->message == NULL;
283  break;
284  case 500: /* Internal Server Error */
285  case 501: /* Not Implemented */
286  case 400: /* Invalid parameters for sending a message. */
287  case 404: /* Endpoints not found */
288  is_valid = 1;
289  break;
290  default:
291  if (200 <= code && code <= 299) {
292  is_valid = ast_ari_validate_endpoint(
293  response->message);
294  } else {
295  ast_log(LOG_ERROR, "Invalid error response %d for /endpoints/{tech}/{resource}\n", code);
296  is_valid = 0;
297  }
298  }
299 
300  if (!is_valid) {
301  ast_log(LOG_ERROR, "Response validation failed for /endpoints/{tech}/{resource}\n");
302  ast_ari_response_error(response, 500,
303  "Internal Server Error", "Response validation failed");
304  }
305 #endif /* AST_DEVMODE */
306 
307 fin: __attribute__((unused))
308  return;
309 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
void ast_ari_endpoints_get(struct ast_variable *headers, struct ast_ari_endpoints_get_args *args, struct ast_ari_response *response)
Details for an endpoint.
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
int ast_ari_validate_endpoint(struct ast_json *json)
Validator for Endpoint.
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
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_endpoints_list_by_tech_cb()

static void ast_ari_endpoints_list_by_tech_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 /endpoints/{tech}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 197 of file res_ari_endpoints.c.

References ast_ari_endpoints_list_by_tech(), ast_ari_response_error(), ast_ari_validate_endpoint_fn(), ast_ari_validate_list(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, ast_ari_endpoints_list_by_tech_args::tech, and ast_variable::value.

201 {
203  struct ast_variable *i;
204 #if defined(AST_DEVMODE)
205  int is_valid;
206  int code;
207 #endif /* AST_DEVMODE */
208 
209  for (i = path_vars; i; i = i->next) {
210  if (strcmp(i->name, "tech") == 0) {
211  args.tech = (i->value);
212  } else
213  {}
214  }
215  ast_ari_endpoints_list_by_tech(headers, &args, response);
216 #if defined(AST_DEVMODE)
217  code = response->response_code;
218 
219  switch (code) {
220  case 0: /* Implementation is still a stub, or the code wasn't set */
221  is_valid = response->message == NULL;
222  break;
223  case 500: /* Internal Server Error */
224  case 501: /* Not Implemented */
225  case 404: /* Endpoints not found */
226  is_valid = 1;
227  break;
228  default:
229  if (200 <= code && code <= 299) {
230  is_valid = ast_ari_validate_list(response->message,
232  } else {
233  ast_log(LOG_ERROR, "Invalid error response %d for /endpoints/{tech}\n", code);
234  is_valid = 0;
235  }
236  }
237 
238  if (!is_valid) {
239  ast_log(LOG_ERROR, "Response validation failed for /endpoints/{tech}\n");
240  ast_ari_response_error(response, 500,
241  "Internal Server Error", "Response validation failed");
242  }
243 #endif /* AST_DEVMODE */
244 
245 fin: __attribute__((unused))
246  return;
247 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
void ast_ari_endpoints_list_by_tech(struct ast_variable *headers, struct ast_ari_endpoints_list_by_tech_args *args, struct ast_ari_response *response)
List available endoints for a given endpoint technology.
#define LOG_ERROR
Definition: logger.h:285
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
struct ast_json * message
Definition: ari.h:93
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
ari_validator ast_ari_validate_endpoint_fn(void)
Function pointer to ast_ari_validate_endpoint().

◆ ast_ari_endpoints_list_cb()

static void ast_ari_endpoints_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 /endpoints.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 60 of file res_ari_endpoints.c.

References ast_ari_endpoints_list(), ast_ari_response_error(), ast_ari_validate_endpoint_fn(), ast_ari_validate_list(), ast_log, LOG_ERROR, ast_ari_response::message, NULL, and ast_ari_response::response_code.

64 {
66 #if defined(AST_DEVMODE)
67  int is_valid;
68  int code;
69 #endif /* AST_DEVMODE */
70 
71  ast_ari_endpoints_list(headers, &args, response);
72 #if defined(AST_DEVMODE)
73  code = response->response_code;
74 
75  switch (code) {
76  case 0: /* Implementation is still a stub, or the code wasn't set */
77  is_valid = response->message == NULL;
78  break;
79  case 500: /* Internal Server Error */
80  case 501: /* Not Implemented */
81  is_valid = 1;
82  break;
83  default:
84  if (200 <= code && code <= 299) {
85  is_valid = ast_ari_validate_list(response->message,
87  } else {
88  ast_log(LOG_ERROR, "Invalid error response %d for /endpoints\n", code);
89  is_valid = 0;
90  }
91  }
92 
93  if (!is_valid) {
94  ast_log(LOG_ERROR, "Response validation failed for /endpoints\n");
95  ast_ari_response_error(response, 500,
96  "Internal Server Error", "Response validation failed");
97  }
98 #endif /* AST_DEVMODE */
99 
100 fin: __attribute__((unused))
101  return;
102 }
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
void ast_ari_endpoints_list(struct ast_variable *headers, struct ast_ari_endpoints_list_args *args, struct ast_ari_response *response)
List all endpoints.
#define LOG_ERROR
Definition: logger.h:285
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
struct ast_json * message
Definition: ari.h:93
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
ari_validator ast_ari_validate_endpoint_fn(void)
Function pointer to ast_ari_validate_endpoint().

◆ ast_ari_endpoints_send_message_cb()

static void ast_ari_endpoints_send_message_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 /endpoints/sendMessage.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 131 of file res_ari_endpoints.c.

References ast_ari_endpoints_send_message(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, ast_ari_endpoints_send_message_args::body, ast_ari_endpoints_send_message_args::from, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, ast_ari_endpoints_send_message_args::to, ast_variable::value, and ast_ari_endpoints_send_message_args::variables.

135 {
137  struct ast_variable *i;
138 #if defined(AST_DEVMODE)
139  int is_valid;
140  int code;
141 #endif /* AST_DEVMODE */
142 
143  for (i = get_params; i; i = i->next) {
144  if (strcmp(i->name, "to") == 0) {
145  args.to = (i->value);
146  } else
147  if (strcmp(i->name, "from") == 0) {
148  args.from = (i->value);
149  } else
150  if (strcmp(i->name, "body") == 0) {
151  args.body = (i->value);
152  } else
153  {}
154  }
155  args.variables = body;
156  ast_ari_endpoints_send_message(headers, &args, response);
157 #if defined(AST_DEVMODE)
158  code = response->response_code;
159 
160  switch (code) {
161  case 0: /* Implementation is still a stub, or the code wasn't set */
162  is_valid = response->message == NULL;
163  break;
164  case 500: /* Internal Server Error */
165  case 501: /* Not Implemented */
166  case 400: /* Invalid parameters for sending a message. */
167  case 404: /* Endpoint not found */
168  is_valid = 1;
169  break;
170  default:
171  if (200 <= code && code <= 299) {
172  is_valid = ast_ari_validate_void(
173  response->message);
174  } else {
175  ast_log(LOG_ERROR, "Invalid error response %d for /endpoints/sendMessage\n", code);
176  is_valid = 0;
177  }
178  }
179 
180  if (!is_valid) {
181  ast_log(LOG_ERROR, "Response validation failed for /endpoints/sendMessage\n");
182  ast_ari_response_error(response, 500,
183  "Internal Server Error", "Response validation failed");
184  }
185 #endif /* AST_DEVMODE */
186 
187 fin: __attribute__((unused))
188  return;
189 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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
struct ast_json * message
Definition: ari.h:93
void ast_ari_endpoints_send_message(struct ast_variable *headers, struct ast_ari_endpoints_send_message_args *args, struct ast_ari_response *response)
Send a message to some technology URI or endpoint.

◆ ast_ari_endpoints_send_message_parse_body()

int ast_ari_endpoints_send_message_parse_body ( struct ast_json body,
struct ast_ari_endpoints_send_message_args args 
)

Body parsing function for /endpoints/sendMessage.

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 103 of file res_ari_endpoints.c.

References ast_json_object_get(), ast_json_string_get(), ast_ari_endpoints_send_message_args::body, ast_ari_endpoints_send_message_args::from, and ast_ari_endpoints_send_message_args::to.

Referenced by ast_ari_endpoints_send_message().

106 {
107  struct ast_json *field;
108  /* Parse query parameters out of it */
109  field = ast_json_object_get(body, "to");
110  if (field) {
111  args->to = ast_json_string_get(field);
112  }
113  field = ast_json_object_get(body, "from");
114  if (field) {
115  args->from = ast_json_string_get(field);
116  }
117  field = ast_json_object_get(body, "body");
118  if (field) {
119  args->body = ast_json_string_get(field);
120  }
121  return 0;
122 }
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
Abstract JSON element (object, array, string, int, ...).

◆ ast_ari_endpoints_send_message_to_endpoint_cb()

static void ast_ari_endpoints_send_message_to_endpoint_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 /endpoints/{tech}/{resource}/sendMessage.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 334 of file res_ari_endpoints.c.

References ast_ari_endpoints_send_message_to_endpoint(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, ast_ari_endpoints_send_message_to_endpoint_args::body, ast_ari_endpoints_send_message_to_endpoint_args::from, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_endpoints_send_message_to_endpoint_args::resource, ast_ari_response::response_code, ast_ari_endpoints_send_message_to_endpoint_args::tech, ast_variable::value, and ast_ari_endpoints_send_message_to_endpoint_args::variables.

338 {
340  struct ast_variable *i;
341 #if defined(AST_DEVMODE)
342  int is_valid;
343  int code;
344 #endif /* AST_DEVMODE */
345 
346  for (i = get_params; i; i = i->next) {
347  if (strcmp(i->name, "from") == 0) {
348  args.from = (i->value);
349  } else
350  if (strcmp(i->name, "body") == 0) {
351  args.body = (i->value);
352  } else
353  {}
354  }
355  for (i = path_vars; i; i = i->next) {
356  if (strcmp(i->name, "tech") == 0) {
357  args.tech = (i->value);
358  } else
359  if (strcmp(i->name, "resource") == 0) {
360  args.resource = (i->value);
361  } else
362  {}
363  }
364  args.variables = body;
365  ast_ari_endpoints_send_message_to_endpoint(headers, &args, response);
366 #if defined(AST_DEVMODE)
367  code = response->response_code;
368 
369  switch (code) {
370  case 0: /* Implementation is still a stub, or the code wasn't set */
371  is_valid = response->message == NULL;
372  break;
373  case 500: /* Internal Server Error */
374  case 501: /* Not Implemented */
375  case 400: /* Invalid parameters for sending a message. */
376  case 404: /* Endpoint not found */
377  is_valid = 1;
378  break;
379  default:
380  if (200 <= code && code <= 299) {
381  is_valid = ast_ari_validate_void(
382  response->message);
383  } else {
384  ast_log(LOG_ERROR, "Invalid error response %d for /endpoints/{tech}/{resource}/sendMessage\n", code);
385  is_valid = 0;
386  }
387  }
388 
389  if (!is_valid) {
390  ast_log(LOG_ERROR, "Response validation failed for /endpoints/{tech}/{resource}/sendMessage\n");
391  ast_ari_response_error(response, 500,
392  "Internal Server Error", "Response validation failed");
393  }
394 #endif /* AST_DEVMODE */
395 
396 fin: __attribute__((unused))
397  return;
398 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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
struct ast_json * message
Definition: ari.h:93
void ast_ari_endpoints_send_message_to_endpoint(struct ast_variable *headers, struct ast_ari_endpoints_send_message_to_endpoint_args *args, struct ast_ari_response *response)
Send a message to some endpoint in a technology.

◆ ast_ari_endpoints_send_message_to_endpoint_parse_body()

int ast_ari_endpoints_send_message_to_endpoint_parse_body ( struct ast_json body,
struct ast_ari_endpoints_send_message_to_endpoint_args args 
)

Body parsing function for /endpoints/{tech}/{resource}/sendMessage.

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 310 of file res_ari_endpoints.c.

References ast_json_object_get(), ast_json_string_get(), ast_ari_endpoints_send_message_to_endpoint_args::body, and ast_ari_endpoints_send_message_to_endpoint_args::from.

Referenced by ast_ari_endpoints_send_message_to_endpoint().

313 {
314  struct ast_json *field;
315  /* Parse query parameters out of it */
316  field = ast_json_object_get(body, "from");
317  if (field) {
318  args->from = ast_json_string_get(field);
319  }
320  field = ast_json_object_get(body, "body");
321  if (field) {
322  args->body = ast_json_string_get(field);
323  }
324  return 0;
325 }
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
Abstract JSON element (object, array, string, int, ...).

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 473 of file res_ari_endpoints.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 454 of file res_ari_endpoints.c.

References ast_ari_add_handler(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, and unload_module().

455 {
456  int res = 0;
457 
458 
460  if (res) {
461  unload_module();
463  }
464 
466 }
static int unload_module(void)
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:179
static struct stasis_rest_handlers endpoints
REST handler for /api-docs/endpoints.json.
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 448 of file res_ari_endpoints.c.

References ast_ari_remove_handler().

Referenced by load_module().

449 {
451  return 0;
452 }
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:202
static struct stasis_rest_handlers endpoints
REST handler for /api-docs/endpoints.json.

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "RESTful API module - Endpoint 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", }
static

Definition at line 473 of file res_ari_endpoints.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 473 of file res_ari_endpoints.c.

◆ endpoints

struct stasis_rest_handlers endpoints
static

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

Definition at line 439 of file res_ari_endpoints.c.

◆ endpoints_sendMessage

struct stasis_rest_handlers endpoints_sendMessage
static

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

Definition at line 401 of file res_ari_endpoints.c.

◆ endpoints_tech

struct stasis_rest_handlers endpoints_tech
static

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

Definition at line 429 of file res_ari_endpoints.c.

◆ endpoints_tech_resource

struct stasis_rest_handlers endpoints_tech_resource
static

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

Definition at line 419 of file res_ari_endpoints.c.

◆ endpoints_tech_resource_sendMessage

struct stasis_rest_handlers endpoints_tech_resource_sendMessage
static

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

Definition at line 410 of file res_ari_endpoints.c.