19 #ifndef _ASTERISK_HTTP_H 20 #define _ASTERISK_HTTP_H 201 int status_code,
const char *status_title,
struct ast_str *http_header,
202 struct ast_str *
out,
int fd,
unsigned int static_content);
224 const char *status_title,
struct ast_str *http_header_data,
const char *
text);
338 const char *
value,
const char *expected_value);
355 const char *
value,
const char *expected_value);
struct ast_http_uri::@265 entry
void ast_http_error(struct ast_tcptls_session_instance *ser, int status, const char *title, const char *text)
Send HTTP error message and close socket.
ast_http_callback callback
int ast_http_body_discard(struct ast_tcptls_session_instance *ser)
Read and discard any unread HTTP request body.
void ast_http_auth(struct ast_tcptls_session_instance *ser, const char *realm, const unsigned long nonce, const unsigned long opaque, int stale, const char *text)
Send http "401 Unauthorized" response and close socket.
int ast_http_uri_link(struct ast_http_uri *urihandler)
Register a URI handler.
const char * ast_http_ftype2mtype(const char *ftype) attribute_pure
Return mime type based on extension.
int(* ast_http_callback)(struct ast_tcptls_session_instance *ser, const struct ast_http_uri *urih, const char *uri, enum ast_http_method method, struct ast_variable *get_params, struct ast_variable *headers)
HTTP Callbacks.
Structure for variables, used for configurations and for channel variables.
void ast_http_uri_unlink(struct ast_http_uri *urihandler)
Unregister a URI handler.
struct ast_json * ast_http_get_json(struct ast_tcptls_session_instance *ser, struct ast_variable *headers)
Get JSON from client Request Entity-Body, if content type is application/json.
uint32_t ast_http_manid_from_vars(struct ast_variable *headers) attribute_pure
Return manager id, if exist, from request headers.
Generic support for tcp/tls servers in Asterisk.
void ast_http_send(struct ast_tcptls_session_instance *ser, enum ast_http_method method, int status_code, const char *status_title, struct ast_str *http_header, struct ast_str *out, int fd, unsigned int static_content)
Generic function for sending HTTP/1.1 response.
Configuration File Parser.
int ast_http_header_parse(char *buf, char **name, char **value)
Parse a header into the given name/value strings.
A set of macros to manage forward-linked lists.
int ast_http_header_match_in(const char *name, const char *expected_name, const char *value, const char *expected_value)
Check if the header name matches the expected header name. If so, then check to see if the value can ...
describes a server instance
int ast_http_header_match(const char *name, const char *expected_name, const char *value, const char *expected_value)
Check if the header and value match (case insensitive) their associated expected values.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_http_body_read_status(struct ast_tcptls_session_instance *ser, int read_success)
Update the body read success status.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
static char version[AST_MAX_EXTENSION]
const char * ast_get_http_method(enum ast_http_method method) attribute_pure
Return http method name string.
void ast_http_create_response(struct ast_tcptls_session_instance *ser, int status_code, const char *status_title, struct ast_str *http_header_data, const char *text)
Creates and sends a formatted http response message.
HTTP authentication information.
Definition of a URI handler.
void ast_http_prefix(char *buf, int len)
Return the current prefix.
struct ast_variable * ast_http_get_post_vars(struct ast_tcptls_session_instance *ser, struct ast_variable *headers)
Get post variables from client Request Entity-Body, if content type is application/x-www-form-urlenco...
void ast_http_uri_unlink_all_with_key(const char *key)
Unregister all handlers with matching key.
struct ast_http_auth * ast_http_get_auth(struct ast_variable *headers)
Get HTTP authentication information from headers.
Abstract JSON element (object, array, string, int, ...).
ast_http_method
HTTP Request methods known by Asterisk.
void ast_http_request_close_on_completion(struct ast_tcptls_session_instance *ser)
Request the HTTP connection be closed after this HTTP request.
unsigned int no_decode_uri
int ast_http_response_status_line(const char *buf, const char *version, int code)
Parse the http response status line.
struct ast_variable * ast_http_get_cookies(struct ast_variable *headers)
Get cookie from Request headers.