Asterisk - The Open Source Telephony Project
21.4.1
|
Data Structures | |
struct | ast_msg_data_attribute |
Functions | |
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. More... | |
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. More... | |
struct ast_msg_data * | ast_msg_data_dup (struct ast_msg_data *msg) |
Clone an ast_msg_data structure. More... | |
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. More... | |
size_t | ast_msg_data_get_length (struct ast_msg_data *msg) |
Get length of the structure. More... | |
enum ast_msg_data_source_type | ast_msg_data_get_source_type (struct ast_msg_data *msg) |
Get "source type" from ast_msg_data. More... | |
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. More... | |
The Enhanced Messaging framework allows attributes, such as "From", "To" and "Content-Type" to be attached to the message by the incoming channel tech which can then be used by the outgoing channel tech to construct the appropriate technology-specific outgoing message.
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.
source | The source type of the message |
attributes | A pointer to an array of ast_msg_data_attribute structures |
count | The number of elements in the array |
Definition at line 1446 of file main/message.c.
References ast_calloc, ast_copy_string(), attribute_value_offsets, buf, and length.
Referenced by ast_msg_data_alloc2(), and ast_sendtext().
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.
source_type | The source type of the message |
to | Where the message is sent to |
from | Where the message is sent from |
content_type | Content type of the body |
body | The message body |
Definition at line 1497 of file main/message.c.
References ast_msg_data_alloc(), and S_OR.
Referenced by queue_sendtext_data().
struct ast_msg_data* ast_msg_data_dup | ( | struct ast_msg_data * | msg | ) |
Clone an ast_msg_data structure.
msg | The message to clone |
Definition at line 1523 of file main/message.c.
References ast_malloc, and length.
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.
msg | Pointer to ast_msg_data structure |
attribute_type | One of ast_msg_data_attribute_type |
Definition at line 1561 of file main/message.c.
References attribute_value_offsets, and buf.
Referenced by ast_bridge_channel_queue_frame(), ast_sendtext_data(), and chan_pjsip_sendtext_data().
size_t ast_msg_data_get_length | ( | struct ast_msg_data * | msg | ) |
Get length of the structure.
msg | Pointer to ast_msg_data structure |
Definition at line 1541 of file main/message.c.
References length.
Referenced by queue_sendtext_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.
msg | Pointer to ast_msg_data structure |
Definition at line 1551 of file main/message.c.
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.
channel | The channel on which to queue the frame |
msg | Pointer to ast_msg_data structure |
-1 | Error |
0 | Success |
Definition at line 1576 of file main/message.c.
References AST_FRAME_TEXT_DATA, ast_queue_frame(), ast_frame::data, ast_frame::datalen, ast_frame::frametype, and length.