33 #ifndef __AST_MESSAGE_H__ 34 #define __AST_MESSAGE_H__ 36 #if defined(__cplusplus) || defined(c_plusplus) 112 int (*
const handle_msg)(
struct ast_msg *msg);
127 int (*
const has_destination)(
const struct ast_msg *msg);
186 int __attribute__((
format(printf, 2, 3)))
195 int __attribute__((
format(printf, 2, 3)))
204 int __attribute__((
format(printf, 2, 3)))
213 int __attribute__((
format(printf, 2, 3)))
222 int __attribute__((
format(printf, 2, 3)))
233 int __attribute__((
format(printf, 2, 3)))
244 int __attribute__((
format(printf, 2, 3)))
410 struct ast_msg_var_iterator *iter, const
char **name, const
char **value);
498 const char *to,
const char *from,
const char *content_type,
const char *body);
564 #if defined(__cplusplus) || defined(c_plusplus) size_t ast_msg_data_get_length(struct ast_msg_data *msg)
Get length of the structure.
int ast_msg_handler_unregister(const struct ast_msg_handler *handler)
Unregister a ast_msg_handler.
Main Channel structure associated with a channel.
int ast_msg_set_tech(struct ast_msg *msg, const char *fmt,...)
Set the technology associated with this message.
const char * ast_msg_get_var(struct ast_msg *msg, const char *name)
Get the specified variable on the message.
enum ast_msg_data_source_type ast_msg_data_get_source_type(struct ast_msg_data *msg)
Get "source type" from ast_msg_data.
const char * ast_msg_get_tech(const struct ast_msg *msg)
Retrieve the technology associated with this message.
int ast_msg_set_context(struct ast_msg *msg, const char *fmt,...)
Set the dialplan context for this message.
struct ast_msg_data * ast_msg_data_dup(struct ast_msg_data *msg)
Clone an ast_msg_data structure.
const char * ast_msg_get_endpoint(const struct ast_msg *msg)
Retrieve the endpoint associated with this message.
int ast_msg_set_body(struct ast_msg *msg, const char *fmt,...)
Set the 'body' text of a message (in UTF-8)
An external processor of received messages.
int ast_msg_handler_register(const struct ast_msg_handler *handler)
Register a ast_msg_handler.
struct ast_msg * ast_msg_alloc(void)
Allocate a message.
const ast_string_field to
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 *const name
Name of this message technology.
Structure used to transport a message through the frame core.
int ast_msg_tech_register(const struct ast_msg_tech *tech)
Register a message technology.
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.
const char * ast_msg_get_body(const struct ast_msg *msg)
Get the body of a message.
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.
void ast_msg_var_iterator_destroy(struct ast_msg_var_iterator *iter)
Destroy a message variable iterator.
int ast_msg_set_to(struct ast_msg *msg, const char *fmt,...)
Set the 'to' URI of a message.
const char * ast_msg_get_to(const struct ast_msg *msg)
Retrieve the destination of this message.
int ast_msg_send(struct ast_msg *msg, const char *to, const char *from)
Send a msg directly to an endpoint.
enum ast_msg_data_source_type source
void ast_msg_var_unref_current(struct ast_msg_var_iterator *iter)
Unref a message var from inside an iterator loop.
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.
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.
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.
int ast_msg_tech_unregister(const struct ast_msg_tech *tech)
Unregister a message technology.
const char * ast_msg_get_from(const struct ast_msg *msg)
Retrieve the source of this message.
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.
const ast_string_field from
ast_msg_data_attribute_type
int ast_msg_set_exten(struct ast_msg *msg, const char *fmt,...)
Set the dialplan extension for this message.
int ast_msg_set_from(struct ast_msg *msg, const char *fmt,...)
Set the 'from' URI of a message.
const char * name
Name of the message handler.
int ast_msg_set_endpoint(struct ast_msg *msg, const char *fmt,...)
Set the technology's endpoint 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_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.
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.
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)
int(*const msg_send)(const struct ast_msg *msg, const char *to, const char *from)
Send a message.
struct ast_msg * ast_msg_destroy(struct ast_msg *msg)
Destroy an ast_msg.
static snd_pcm_format_t format
const ast_string_field tech
struct ast_msg_var_iterator * ast_msg_var_iterator_init(const struct ast_msg *msg)
Create a new message variable iterator.