33#ifndef __AST_MESSAGE_H__
34#define __AST_MESSAGE_H__
36#if defined(__cplusplus) || defined(c_plusplus)
186int __attribute__((format(printf, 2, 3)))
195int __attribute__((format(printf, 2, 3)))
204int __attribute__((format(printf, 2, 3)))
213int __attribute__((format(printf, 2, 3)))
222int __attribute__((format(printf, 2, 3)))
233int __attribute__((format(printf, 2, 3)))
244int __attribute__((format(printf, 2, 3)))
498 const char *to,
const char *from,
const char *content_type,
const char *body);
564#if defined(__cplusplus) || defined(c_plusplus)
const char * ast_msg_data_get_attribute(struct ast_msg_data *msg, enum ast_msg_data_attribute_type attribute_type)
Get attribute from ast_msg_data.
enum ast_msg_data_source_type ast_msg_data_get_source_type(struct ast_msg_data *msg)
Get "source type" from ast_msg_data.
ast_msg_data_attribute_type
struct ast_msg_data * ast_msg_data_alloc(enum ast_msg_data_source_type source, struct ast_msg_data_attribute attributes[], size_t count)
Allocates an ast_msg_data structure.
struct ast_msg_data * ast_msg_data_alloc2(enum ast_msg_data_source_type source_type, const char *to, const char *from, const char *content_type, const char *body)
Allocates an ast_msg_data structure.
struct ast_msg_data * ast_msg_data_dup(struct ast_msg_data *msg)
Clone an ast_msg_data structure.
int ast_msg_data_queue_frame(struct ast_channel *channel, struct ast_msg_data *msg)
Queue an AST_FRAME_TEXT_DATA frame containing an ast_msg_data structure.
size_t ast_msg_data_get_length(struct ast_msg_data *msg)
Get length of the structure.
@ __AST_MSG_DATA_ATTR_LAST
@ AST_MSG_DATA_ATTR_CONTENT_TYPE
@ __AST_MSG_DATA_SOURCE_TYPE_LAST
@ AST_MSG_DATA_SOURCE_TYPE_UNKNOWN
@ AST_MSG_DATA_SOURCE_TYPE_IN_DIALOG
@ AST_MSG_DATA_SOURCE_TYPE_T140
@ AST_MSG_DATA_SOURCE_TYPE_OUT_OF_DIALOG
int ast_msg_set_from(struct ast_msg *msg, const char *fmt,...)
Set the 'from' URI of a message.
int ast_msg_send(struct ast_msg *msg, const char *to, const char *from)
Send a msg directly to an endpoint.
const char * ast_msg_get_var(struct ast_msg *msg, const char *name)
Get the specified variable on the message.
int ast_msg_handler_unregister(const struct ast_msg_handler *handler)
Unregister a ast_msg_handler.
const char * ast_msg_get_from(const struct ast_msg *msg)
Retrieve the source of this message.
void ast_msg_var_iterator_destroy(struct ast_msg_var_iterator *iter)
Destroy a message variable iterator.
struct ast_msg * ast_msg_destroy(struct ast_msg *msg)
Destroy an ast_msg.
int ast_msg_set_endpoint(struct ast_msg *msg, const char *fmt,...)
Set the technology's endpoint associated with this message.
int ast_msg_var_iterator_next(const struct ast_msg *msg, struct ast_msg_var_iterator *iter, const char **name, const char **value)
Get the next variable name and value that is set for sending outbound.
const char * ast_msg_get_endpoint(const struct ast_msg *msg)
Retrieve the endpoint associated with this message.
int ast_msg_set_exten(struct ast_msg *msg, const char *fmt,...)
Set the dialplan extension for this message.
int ast_msg_set_tech(struct ast_msg *msg, const char *fmt,...)
Set the technology associated with this message.
int ast_msg_has_destination(const struct ast_msg *msg)
Determine if a particular message has a destination via some handler.
struct ast_msg * ast_msg_alloc(void)
Allocate a message.
int ast_msg_tech_unregister(const struct ast_msg_tech *tech)
Unregister a message technology.
int ast_msg_set_var(struct ast_msg *msg, const char *name, const char *value)
Set a variable on the message going to the dialplan.
const char * ast_msg_get_to(const struct ast_msg *msg)
Retrieve the destination of this message.
const char * ast_msg_get_tech(const struct ast_msg *msg)
Retrieve the technology associated with this message.
int ast_msg_tech_register(const struct ast_msg_tech *tech)
Register a message technology.
const char * ast_msg_get_body(const struct ast_msg *msg)
Get the body of a message.
int ast_msg_handler_register(const struct ast_msg_handler *handler)
Register a ast_msg_handler.
int ast_msg_set_context(struct ast_msg *msg, const char *fmt,...)
Set the dialplan context for this message.
int ast_msg_set_body(struct ast_msg *msg, const char *fmt,...)
Set the 'body' text of a message (in UTF-8)
int ast_msg_var_iterator_next_received(const struct ast_msg *msg, struct ast_msg_var_iterator *iter, const char **name, const char **value)
Get the next variable name and value that was set on a received message.
int ast_msg_set_to(struct ast_msg *msg, const char *fmt,...)
Set the 'to' URI of a message.
void ast_msg_var_unref_current(struct ast_msg_var_iterator *iter)
Unref a message var from inside an iterator loop.
struct ast_msg_var_iterator * ast_msg_var_iterator_init(const struct ast_msg *msg)
Create a new message variable iterator.
int ast_msg_set_var_outbound(struct ast_msg *msg, const char *name, const char *value)
Set a variable on the message being sent to a message tech directly.
int ast_msg_queue(struct ast_msg *msg)
Queue a message for routing through the dialplan.
struct ast_msg * ast_msg_ref(struct ast_msg *msg)
Bump a msg's ref count.
Main Channel structure associated with a channel.
enum ast_msg_data_attribute_type type
Structure used to transport a message through the frame core.
enum ast_msg_data_source_type source
An external processor of received messages.
int(*const has_destination)(const struct ast_msg *msg)
Return whether or not the message has a valid destination.
const char * name
Name of the message handler.
int(*const handle_msg)(struct ast_msg *msg)
The function callback that will handle the message.
int(*const msg_send)(const struct ast_msg *msg, const char *to, const char *from)
Send a message.
const char *const name
Name of this message technology.
const ast_string_field tech
const ast_string_field from
const ast_string_field to
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)