19 #ifndef _ASTERISK_ARI_H 20 #define _ASTERISK_ARI_H 232 const char *response_text,
233 const char *message_fmt, ...)
234 __attribute__((
format(printf, 4, 5)));
const char * ast_ari_websocket_session_id(const struct ast_ari_websocket_session *session)
Get the Session ID for an ARI WebSocket.
enum ast_json_encoding_format ast_ari_json_format(void)
Configured encoding format for JSON output.
int(* validator)(struct ast_json *)
void ast_ari_response_created(struct ast_ari_response *response, const char *url, struct ast_json *message)
Fill in a Created (201) ast_ari_response.
Structure for a WebSocket server.
void ast_ari_get_docs(const char *uri, const char *prefix, struct ast_variable *headers, struct ast_ari_response *response)
Structure for variables, used for configurations and for channel variables.
struct ast_sockaddr * ast_ari_websocket_session_get_remote_addr(struct ast_ari_websocket_session *session)
Get the remote address from an ARI WebSocket.
struct ast_json * ast_ari_websocket_session_read(struct ast_ari_websocket_session *session)
Read a message from an ARI WebSocket.
struct ast_ari_websocket_session * ast_ari_websocket_session_create(struct ast_websocket *ws_session, int(*validator)(struct ast_json *))
Create an ARI WebSocket session.
struct ast_json * ast_ari_oom_json(void)
The stock message to return when out of memory.
void ast_ari_invoke(struct ast_tcptls_session_instance *ser, const char *uri, enum ast_http_method method, struct ast_variable *get_params, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
Socket address structure.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
Support for Private Asterisk HTTP Servers.
Asterisk JSON abstraction layer.
static struct ast_mansession session
void ast_ari_response_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) ast_ari_response.
struct ast_websocket * ws_session
describes a server instance
struct ast_websocket_server * ws_server
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
void ast_ari_response_accepted(struct ast_ari_response *response)
Fill in a Accepted (202) ast_ari_response.
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
const char * response_text
Structure definition for session.
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.
void ast_ari_response_no_content(struct ast_ari_response *response)
Fill in a No Content (204) ast_ari_response.
void(* stasis_rest_callback)(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)
Callback type for RESTful method handlers.
struct ast_json * message
const char * path_segment
struct stasis_rest_handlers * children[]
static void handler(const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
stasis_rest_callback callbacks[AST_HTTP_MAX_METHOD]
Abstract JSON element (object, array, string, int, ...).
ast_http_method
HTTP Request methods known by Asterisk.
static snd_pcm_format_t format
int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session, struct ast_json *message)
Send a message to an ARI WebSocket.
Handler for a single RESTful path segment.
ast_json_encoding_format
Encoding format type.
static char prefix[MAX_PREFIX]