33 #ifndef __AST_MESSAGE_H__
34 #define __AST_MESSAGE_H__
36 #if defined(__cplusplus) || defined(c_plusplus)
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);
446 enum ast_msg_data_source_type {
447 AST_MSG_DATA_SOURCE_TYPE_UNKNOWN = 0,
448 AST_MSG_DATA_SOURCE_TYPE_T140,
449 AST_MSG_DATA_SOURCE_TYPE_IN_DIALOG,
450 AST_MSG_DATA_SOURCE_TYPE_OUT_OF_DIALOG,
451 __AST_MSG_DATA_SOURCE_TYPE_LAST,
454 enum ast_msg_data_attribute_type {
455 AST_MSG_DATA_ATTR_TO = 0,
456 AST_MSG_DATA_ATTR_FROM,
457 AST_MSG_DATA_ATTR_CONTENT_TYPE,
458 AST_MSG_DATA_ATTR_BODY,
459 __AST_MSG_DATA_ATTR_LAST,
463 enum ast_msg_data_attribute_type type;
498 const char *to,
const char *from,
const char *content_type,
const char *body);
545 enum ast_msg_data_attribute_type attribute_type);
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(*const handle_msg)(struct ast_msg *msg)
The function callback that will handle the 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.
int(*const has_destination)(const struct ast_msg *msg)
Return whether or not the message has a valid destination.
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.
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
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.
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.
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.