19#ifndef _ASTERISK_ARI_H
20#define _ASTERISK_ARI_H
234 const char *response_text,
235 const char *message_fmt, ...)
236__attribute__((format(printf, 4, 5)));
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_websocket_session_read(struct ast_ari_websocket_session *session)
Read a message from an ARI WebSocket.
enum ast_json_encoding_format ast_ari_json_format(void)
Configured encoding format for JSON output.
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.
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
const char * ast_ari_websocket_session_id(const struct ast_ari_websocket_session *session)
Get the Session ID for an ARI WebSocket.
struct ast_sockaddr * ast_ari_websocket_session_get_remote_addr(struct ast_ari_websocket_session *session)
Get the remote address from an ARI WebSocket.
int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session, struct ast_json *message)
Send a message to an ARI WebSocket.
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_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)
void ast_ari_response_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) 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.
void ast_ari_response_accepted(struct ast_ari_response *response)
Fill in a Accepted (202) ast_ari_response.
struct ast_json * ast_ari_oom_json(void)
The stock message to return when out of memory.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
void ast_ari_response_no_content(struct ast_ari_response *response)
Fill in a No Content (204) ast_ari_response.
void ast_ari_get_docs(const char *uri, const char *prefix, struct ast_variable *headers, struct ast_ari_response *response)
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
static struct ast_mansession session
static char prefix[MAX_PREFIX]
Support for Private Asterisk HTTP Servers.
ast_http_method
HTTP Request methods known by Asterisk.
Asterisk JSON abstraction layer.
ast_json_encoding_format
Encoding format type.
struct ast_json * message
const char * response_text
struct ast_websocket * ws_session
int(* validator)(struct ast_json *)
Abstract JSON element (object, array, string, int, ...).
Socket address structure.
Support for dynamic strings.
describes a server instance
Structure for variables, used for configurations and for channel variables.
Structure for a WebSocket server.
Structure definition for session.
Handler for a single RESTful path segment.
stasis_rest_callback callbacks[AST_HTTP_MAX_METHOD]
const char * path_segment
struct ast_websocket_server * ws_server
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)