Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Out-of-call text message support. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/module.h"
#include "asterisk/datastore.h"
#include "asterisk/pbx.h"
#include "asterisk/manager.h"
#include "asterisk/strings.h"
#include "asterisk/astobj2.h"
#include "asterisk/vector.h"
#include "asterisk/app.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/message.h"
Go to the source code of this file.
Data Structures | |
struct | ast_msg |
A message. More... | |
struct | ast_msg_data |
Structure used to transport a message through the frame core. More... | |
struct | ast_msg_var_iterator |
struct | msg_data |
struct | outhead |
Macros | |
#define | ATTRIBUTE_UNSET -1 |
Functions | |
static void | __init_msg_q_chan (void) |
static int | action_messagesend (struct mansession *s, const struct message *m) |
struct ast_msg * | ast_msg_alloc (void) |
Allocate a message. More... | |
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... | |
struct ast_msg * | ast_msg_destroy (struct ast_msg *msg) |
Destroy an ast_msg. More... | |
const char * | ast_msg_get_body (const struct ast_msg *msg) |
Get the body of a message. More... | |
const char * | ast_msg_get_endpoint (const struct ast_msg *msg) |
Retrieve the endpoint associated with this message. More... | |
const char * | ast_msg_get_from (const struct ast_msg *msg) |
Retrieve the source of this message. More... | |
const char * | ast_msg_get_tech (const struct ast_msg *msg) |
Retrieve the technology associated with this message. More... | |
const char * | ast_msg_get_to (const struct ast_msg *msg) |
Retrieve the destination of this message. More... | |
const char * | ast_msg_get_var (struct ast_msg *msg, const char *name) |
Get the specified variable on the message. More... | |
int | ast_msg_handler_register (const struct ast_msg_handler *handler) |
Register a ast_msg_handler . More... | |
int | ast_msg_handler_unregister (const struct ast_msg_handler *handler) |
Unregister a ast_msg_handler . More... | |
int | ast_msg_has_destination (const struct ast_msg *msg) |
Determine if a particular message has a destination via some handler. More... | |
int | ast_msg_init (void) |
int | ast_msg_queue (struct ast_msg *msg) |
Queue a message for routing through the dialplan. More... | |
struct ast_msg * | ast_msg_ref (struct ast_msg *msg) |
Bump a msg's ref count. More... | |
int | ast_msg_send (struct ast_msg *msg, const char *to, const char *from) |
Send a msg directly to an endpoint. More... | |
int | ast_msg_set_body (struct ast_msg *msg, const char *fmt,...) |
Set the 'body' text of a message (in UTF-8) More... | |
int | ast_msg_set_context (struct ast_msg *msg, const char *fmt,...) |
Set the dialplan context for this message. More... | |
int | ast_msg_set_endpoint (struct ast_msg *msg, const char *fmt,...) |
Set the technology's endpoint associated with this message. More... | |
int | ast_msg_set_exten (struct ast_msg *msg, const char *fmt,...) |
Set the dialplan extension for this message. More... | |
int | ast_msg_set_from (struct ast_msg *msg, const char *fmt,...) |
Set the 'from' URI of a message. More... | |
int | ast_msg_set_tech (struct ast_msg *msg, const char *fmt,...) |
Set the technology associated with this message. More... | |
int | ast_msg_set_to (struct ast_msg *msg, const char *fmt,...) |
Set the 'to' URI of a message. More... | |
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. More... | |
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. More... | |
void | ast_msg_shutdown (void) |
int | ast_msg_tech_register (const struct ast_msg_tech *tech) |
Register a message technology. More... | |
int | ast_msg_tech_unregister (const struct ast_msg_tech *tech) |
Unregister a message technology. More... | |
void | ast_msg_var_iterator_destroy (struct ast_msg_var_iterator *iter) |
Destroy a message variable iterator. More... | |
static int | ast_msg_var_iterator_get_next (const struct ast_msg *msg, struct ast_msg_var_iterator *iter, const char **name, const char **value, unsigned int send) |
struct ast_msg_var_iterator * | ast_msg_var_iterator_init (const struct ast_msg *msg) |
Create a new message variable iterator. More... | |
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. More... | |
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. More... | |
void | ast_msg_var_unref_current (struct ast_msg_var_iterator *iter) |
Unref a message var from inside an iterator loop. More... | |
static void | chan_cleanup (struct ast_channel *chan) |
static int | chan_msg_indicate (struct ast_channel *chan, int condition, const void *data, size_t datalen) |
static struct ast_frame * | chan_msg_read (struct ast_channel *chan) |
static int | chan_msg_send_digit_begin (struct ast_channel *chan, char digit) |
static int | chan_msg_send_digit_end (struct ast_channel *chan, char digit, unsigned int duration) |
static int | chan_msg_write (struct ast_channel *chan, struct ast_frame *fr) |
static struct ast_channel * | create_msg_q_chan (void) |
static void | destroy_msg_q_chan (void *data) |
static int | dialplan_handle_msg_cb (struct ast_msg *msg) |
static int | dialplan_has_destination_cb (const struct ast_msg *msg) |
static void | message_shutdown (void) |
static struct msg_data * | msg_data_alloc (void) |
static int | msg_data_cmp_fn (void *obj, void *arg, int flags) |
static void | msg_data_destructor (void *obj) |
static struct msg_data * | msg_data_find (struct ao2_container *vars, const char *name) |
static int | msg_data_func_read (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
static int | msg_data_func_write (struct ast_channel *chan, const char *function, char *data, const char *value) |
static struct ast_datastore * | msg_datastore_find_or_create (struct ast_channel *chan) |
static void | msg_destructor (void *obj) |
static void | msg_ds_destroy (void *data) |
static const struct ast_msg_tech * | msg_find_by_tech_name (const char *tech_name) |
static int | msg_func_read (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
static int | msg_func_write (struct ast_channel *chan, const char *function, char *data, const char *value) |
static int | msg_handler_cmp (const struct ast_msg_handler *vec_elem, const struct ast_msg_handler *srch) |
Comparison callback for ast_msg_handler vector removal. More... | |
static const struct ast_msg_handler * | msg_handler_find_by_tech_name (const char *tech_name) |
static int | msg_q_cb (void *data) |
static void | msg_route (struct ast_channel *chan, struct ast_msg *msg) |
static int | msg_send_exec (struct ast_channel *chan, const char *data) |
static int | msg_set_var_full (struct ast_msg *msg, const char *name, const char *value, unsigned int outbound) |
static int | msg_tech_cmp (const struct ast_msg_tech *vec_elem, const struct ast_msg_tech *srch) |
Comparison callback for ast_msg_tech vector removal. More... | |
Variables | |
static const char | app_msg_send [] = "MessageSend" |
static struct ast_msg_handler | dialplan_msg_handler |
static struct ast_channel_tech | msg_chan_tech_hack |
static struct ast_custom_function | msg_data_function |
static const struct ast_datastore_info | msg_datastore |
static struct ast_custom_function | msg_function |
struct { | |
size_t current | |
const struct ast_msg_handler ** elems | |
size_t max | |
} | msg_handlers |
Vector of received message handlers. More... | |
static ast_rwlock_t | msg_handlers_lock |
Lock for msg_handlers vector. More... | |
static struct ast_threadstorage | msg_q_chan = { .once = PTHREAD_ONCE_INIT , .key_init = __init_msg_q_chan , .custom_init = NULL , } |
static struct ast_taskprocessor * | msg_q_tp |
struct { | |
size_t current | |
const struct ast_msg_tech ** elems | |
size_t max | |
} | msg_techs |
Vector of message technologies. More... | |
static ast_rwlock_t | msg_techs_lock |
Lock for msg_techs vector. More... | |
Out-of-call text message support.
Definition in file main/message.c.
#define ATTRIBUTE_UNSET -1 |
Definition at line 1444 of file main/message.c.
|
static |
Definition at line 863 of file main/message.c.
|
static |
Definition at line 1321 of file main/message.c.
References ao2_ref, ast_base64decode(), ast_msg_alloc(), ast_msg_set_body(), ast_msg_set_var_outbound(), ast_rwlock_rdlock, ast_rwlock_unlock, ast_strdupa, ast_string_field_set, ast_strlen_zero(), ast_variables_destroy(), astman_get_header(), astman_get_variables_order(), astman_send_ack(), astman_send_error(), ast_msg::body, ast_msg::from, msg_find_by_tech_name(), ast_msg_tech::msg_send, msg_tech, msg_techs_lock, NULL, ORDER_NATURAL, S_OR, strsep(), ast_msg::to, and ast_msg::vars.
Referenced by ast_msg_init().
struct ast_msg * ast_msg_alloc | ( | void | ) |
Allocate a message.
Allocate a message for the purposes of passing it into the Asterisk core to be routed through the dialplan. If ast_msg_queue() is not called, this message must be destroyed using ast_msg_destroy(). Otherwise, the message core code will take care of it.
Definition at line 432 of file main/message.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_ref, ast_string_field_init, ast_string_field_set, voicemailpwcheck::context, msg_data_cmp_fn(), msg_destructor(), NULL, and ast_msg::vars.
Referenced by action_messagesend(), AST_TEST_DEFINE(), module_on_rx_request(), msg_datastore_find_or_create(), send_message(), and xmpp_pak_message().
Destroy an ast_msg.
This should only be called on a message if it was not passed on to ast_msg_queue().
NULL | always. |
Definition at line 462 of file main/message.c.
Referenced by ast_msg_safe_destroy(), module_on_rx_request(), msg_data_destroy(), send_message(), and xmpp_pak_message().
const char * ast_msg_get_body | ( | const struct ast_msg * | msg | ) |
Get the body of a message.
Definition at line 545 of file main/message.c.
References ast_msg::body.
Referenced by AST_TEST_DEFINE(), msg_send(), msg_to_json(), and xmpp_send_cb().
const char * ast_msg_get_endpoint | ( | const struct ast_msg * | msg | ) |
Retrieve the endpoint associated with this message.
msg | The message to get the endpoint from |
NULL | or empty string if the message has no associated endpoint |
Definition at line 565 of file main/message.c.
References ast_msg::endpoint.
Referenced by AST_TEST_DEFINE(), and msg_to_endpoint().
const char * ast_msg_get_from | ( | const struct ast_msg * | msg | ) |
Retrieve the source of this message.
msg | The message to get the soure from |
NULL | or empty string if the message has no source |
Definition at line 550 of file main/message.c.
References ast_msg::from.
Referenced by AST_TEST_DEFINE(), msg_send(), and msg_to_json().
const char * ast_msg_get_tech | ( | const struct ast_msg * | msg | ) |
Retrieve the technology associated with this message.
msg | The message to get the technology from |
NULL | or empty string if the message has no associated technology |
Definition at line 560 of file main/message.c.
References ast_msg::tech.
Referenced by AST_TEST_DEFINE(), and msg_to_endpoint().
const char * ast_msg_get_to | ( | const struct ast_msg * | msg | ) |
Retrieve the destination of this message.
msg | The message to get the destination from |
NULL | or empty string if the message has no destination |
Definition at line 555 of file main/message.c.
References ast_msg::to.
Referenced by AST_TEST_DEFINE(), msg_send(), msg_to_json(), and test_msg_has_destination_cb().
const char * ast_msg_get_var | ( | struct ast_msg * | msg, |
const char * | name | ||
) |
Get the specified variable on the message.
Definition at line 634 of file main/message.c.
References ao2_ref, msg_data::msg, msg_data_find(), name, NULL, msg_data::value, and ast_msg::vars.
Referenced by AST_TEST_DEFINE(), msg_data_func_read(), and update_content_type().
int ast_msg_handler_register | ( | const struct ast_msg_handler * | handler | ) |
Register a ast_msg_handler
.
handler | The handler to register |
0 | Success |
non-zero | Error |
Definition at line 1657 of file main/message.c.
References ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_APPEND, ast_verb, handler(), LOG_ERROR, match(), msg_handler_find_by_tech_name(), msg_handlers, and msg_handlers_lock.
Referenced by ast_msg_init(), AST_TEST_DEFINE(), and messaging_init().
int ast_msg_handler_unregister | ( | const struct ast_msg_handler * | handler | ) |
Unregister a ast_msg_handler
.
handler | The handler to unregister |
0 | Success |
non-zero | Error |
Definition at line 1699 of file main/message.c.
References ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_REMOVE_CMP_UNORDERED, ast_verb, handler(), LOG_ERROR, match(), msg_handler_cmp(), msg_handlers, and msg_handlers_lock.
Referenced by AST_TEST_DEFINE(), message_shutdown(), and messaging_cleanup().
int ast_msg_has_destination | ( | const struct ast_msg * | msg | ) |
Determine if a particular message has a destination via some handler.
msg | The message to check |
0 | if the message has no handler that can find a destination |
1 | if the message has a handler that can find a destination |
Definition at line 951 of file main/message.c.
References ast_debug, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, handler(), msg_handlers, msg_handlers_lock, and result.
Referenced by AST_TEST_DEFINE(), and module_on_rx_request().
int ast_msg_init | ( | void | ) |
Provided by message.c
Definition at line 1758 of file main/message.c.
References __ast_custom_function_register(), action_messagesend(), app_msg_send, ast_manager_register_xml_core, ast_msg_handler_register(), ast_register_application2(), ast_register_cleanup(), ast_rwlock_init, ast_taskprocessor_get(), AST_VECTOR_INIT, dialplan_msg_handler, EVENT_FLAG_MESSAGE, message_shutdown(), msg_data_function, msg_function, msg_handlers, msg_handlers_lock, msg_q_tp, msg_send_exec(), msg_techs, msg_techs_lock, NULL, and TPS_REF_DEFAULT.
Referenced by asterisk_daemon().
int ast_msg_queue | ( | struct ast_msg * | msg | ) |
Queue a message for routing through the dialplan.
Regardless of the return value of this function, this funciton will take care of ensuring that the message object is properly destroyed when needed.
0 | message successfully queued |
non-zero | failure, message not sent to dialplan |
Definition at line 972 of file main/message.c.
References ao2_ref, ast_taskprocessor_push(), msg_q_cb(), and msg_q_tp.
Referenced by AST_TEST_DEFINE(), module_on_rx_request(), and xmpp_pak_message().
Bump a msg's ref count.
Definition at line 456 of file main/message.c.
References ao2_ref.
Referenced by msg_data_create().
int ast_msg_send | ( | struct ast_msg * | msg, |
const char * | to, | ||
const char * | from | ||
) |
Send a msg directly to an endpoint.
Regardless of the return value of this function, this funciton will take care of ensuring that the message object is properly destroyed when needed.
0 | message successfully queued to be sent out |
non-zero | failure, message not get sent out. |
Definition at line 1397 of file main/message.c.
References ao2_ref, ast_log, ast_rwlock_rdlock, ast_rwlock_unlock, ast_strdupa, ast_strlen_zero(), LOG_ERROR, msg_find_by_tech_name(), ast_msg_tech::msg_send, msg_tech, msg_techs_lock, NULL, S_OR, and strsep().
Referenced by AST_TEST_DEFINE(), and send_message().
int ast_msg_set_body | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the 'body' text of a message (in UTF-8)
0 | success |
-1 | failure |
Definition at line 490 of file main/message.c.
References ast_string_field_build_va, and ast_msg::body.
Referenced by action_messagesend(), AST_TEST_DEFINE(), msg_func_write(), rx_data_to_ast_msg(), send_message(), and xmpp_pak_message().
int ast_msg_set_context | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the dialplan context for this message.
0 | success |
-1 | failure |
Definition at line 501 of file main/message.c.
References ast_string_field_build_va, and voicemailpwcheck::context.
Referenced by AST_TEST_DEFINE(), rx_data_to_ast_msg(), and xmpp_pak_message().
int ast_msg_set_endpoint | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the technology's endpoint associated with this message.
0 | success |
-1 | failure |
Definition at line 534 of file main/message.c.
References ast_string_field_build_va, and ast_msg::endpoint.
Referenced by AST_TEST_DEFINE(), rx_data_to_ast_msg(), and xmpp_pak_message().
int ast_msg_set_exten | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the dialplan extension for this message.
0 | success |
-1 | failure |
Definition at line 512 of file main/message.c.
References ast_string_field_build_va, and ast_msg::exten.
Referenced by AST_TEST_DEFINE(), and rx_data_to_ast_msg().
int ast_msg_set_from | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the 'from' URI of a message.
0 | success |
-1 | failure |
Definition at line 479 of file main/message.c.
References ast_string_field_build_va, and ast_msg::from.
Referenced by AST_TEST_DEFINE(), msg_func_write(), rx_data_to_ast_msg(), send_message(), and xmpp_pak_message().
int ast_msg_set_tech | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the technology associated with this message.
0 | success |
-1 | failure |
Definition at line 523 of file main/message.c.
References ast_string_field_build_va, and ast_msg::tech.
Referenced by AST_TEST_DEFINE(), rx_data_to_ast_msg(), and xmpp_pak_message().
int ast_msg_set_to | ( | struct ast_msg * | msg, |
const char * | fmt, | ||
... | |||
) |
Set the 'to' URI of a message.
0 | success |
-1 | failure |
Definition at line 468 of file main/message.c.
References ast_string_field_build_va, and ast_msg::to.
Referenced by AST_TEST_DEFINE(), msg_func_write(), rx_data_to_ast_msg(), send_message(), and xmpp_pak_message().
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.
msg | |
name | Name of variable to set |
value | Value of variable to set |
0 | success |
-1 | failure |
Definition at line 629 of file main/message.c.
References msg_data::msg, msg_set_var_full(), name, and value.
Referenced by AST_TEST_DEFINE(), headers_to_vars(), rx_data_to_ast_msg(), and xmpp_pak_message().
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.
msg | |
name | Name of variable to set |
value | Value of variable to set |
0 | success |
-1 | failure |
Definition at line 624 of file main/message.c.
References msg_data::msg, msg_set_var_full(), name, and value.
Referenced by action_messagesend(), AST_TEST_DEFINE(), msg_data_func_write(), and send_message().
void ast_msg_shutdown | ( | void | ) |
Provided by message.c
Definition at line 1717 of file main/message.c.
References ast_taskprocessor_unreference(), and msg_q_tp.
Referenced by can_safely_quit().
int ast_msg_tech_register | ( | const struct ast_msg_tech * | tech | ) |
Register a message technology.
0 | success |
non-zero | failure |
Definition at line 1597 of file main/message.c.
References ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_APPEND, ast_verb, LOG_ERROR, match(), msg_find_by_tech_name(), msg_techs, msg_techs_lock, and ast_msg_tech::name.
Referenced by AST_TEST_DEFINE(), and load_module().
int ast_msg_tech_unregister | ( | const struct ast_msg_tech * | tech | ) |
Unregister a message technology.
0 | success |
non-zero | failure |
Definition at line 1638 of file main/message.c.
References ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_REMOVE_CMP_UNORDERED, ast_verb, LOG_ERROR, match(), msg_tech_cmp(), msg_techs, msg_techs_lock, and ast_msg_tech::name.
Referenced by AST_TEST_DEFINE(), load_module(), and unload_module().
void ast_msg_var_iterator_destroy | ( | struct ast_msg_var_iterator * | iter | ) |
Destroy a message variable iterator.
iter | Iterator to be destroyed |
Definition at line 720 of file main/message.c.
References ao2_iterator_destroy(), ast_free, ast_msg_var_unref_current(), and ast_msg_var_iterator::iter.
Referenced by AST_TEST_DEFINE(), msg_to_json(), and vars_to_headers().
|
static |
Definition at line 672 of file main/message.c.
References ao2_iterator_next, ao2_ref, ast_msg_var_iterator::current_used, ast_msg_var_iterator::iter, name, msg_data::name, msg_data::send, msg_data::value, and value.
Referenced by ast_msg_var_iterator_next(), and ast_msg_var_iterator_next_received().
struct ast_msg_var_iterator * ast_msg_var_iterator_init | ( | const struct ast_msg * | msg | ) |
Create a new message variable iterator.
msg | A message whose variables are to be iterated over |
Definition at line 658 of file main/message.c.
References ao2_iterator_init(), ast_calloc, ast_msg_var_iterator::iter, NULL, and ast_msg::vars.
Referenced by AST_TEST_DEFINE(), msg_to_json(), and vars_to_headers().
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.
msg | The message with the variables |
iter | An iterator created with ast_msg_var_iterator_init |
name | A pointer to the name result pointer |
value | A pointer to the value result pointer |
0 | No more entries |
1 | Valid entry |
Definition at line 703 of file main/message.c.
References ast_msg_var_iterator_get_next(), msg_data::msg, name, and value.
Referenced by AST_TEST_DEFINE(), and vars_to_headers().
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.
msg | The message with the variables |
iter | An iterator created with ast_msg_var_iterator_init |
name | A pointer to the name result pointer |
value | A pointer to the value result pointer |
0 | No more entries |
1 | Valid entry |
Definition at line 708 of file main/message.c.
References ast_msg_var_iterator_get_next(), msg_data::msg, name, and value.
Referenced by msg_to_json().
void ast_msg_var_unref_current | ( | struct ast_msg_var_iterator * | iter | ) |
Unref a message var from inside an iterator loop.
Definition at line 714 of file main/message.c.
References ao2_cleanup, ast_msg_var_iterator::current_used, and NULL.
Referenced by ast_msg_var_iterator_destroy(), AST_TEST_DEFINE(), msg_to_json(), and vars_to_headers().
|
static |
Definition at line 788 of file main/message.c.
References ao2_ref, ast_channel_clear_softhangup(), ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_datastores(), ast_channel_internal_alert_flush(), ast_channel_lock, ast_channel_readq(), ast_channel_unlock, ast_channel_varshead(), ast_datastore_free(), ast_frfree, AST_LIST_REMOVE_HEAD, AST_SOFTHANGUP_ALL, ast_var_delete(), ast_datastore::data, msg_datastore, and NULL.
Referenced by dialplan_handle_msg_cb().
|
static |
Definition at line 372 of file main/message.c.
|
static |
|
static |
Definition at line 386 of file main/message.c.
|
static |
Definition at line 399 of file main/message.c.
|
static |
Definition at line 357 of file main/message.c.
|
static |
Definition at line 729 of file main/message.c.
References AST_CHAN_TP_INTERNAL, ast_channel_alloc, ast_channel_datastore_add(), ast_channel_lock, ast_channel_tech_set(), ast_channel_unlink(), ast_channel_unlock, ast_datastore_alloc, ast_hangup(), ast_opt_hide_messaging_ami_events, AST_STATE_UP, msg_chan_tech_hack, msg_datastore, NULL, and ast_channel_tech::properties.
Referenced by dialplan_handle_msg_cb().
|
static |
Definition at line 852 of file main/message.c.
References ast_channel_release(), and ast_channel::data.
|
static |
Definition at line 866 of file main/message.c.
References ao2_ref, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_threadstorage_get(), chan_cleanup(), create_msg_q_chan(), ast_datastore::data, msg_datastore, msg_q_chan, msg_route(), and NULL.
|
static |
Definition at line 897 of file main/message.c.
References ast_exists_extension(), ast_strlen_zero(), ast_msg::context, ast_msg::exten, NULL, and S_OR.
|
static |
Definition at line 1732 of file main/message.c.
References app_msg_send, ast_custom_function_unregister(), ast_manager_unregister(), ast_msg_handler_unregister(), ast_rwlock_destroy, ast_unregister_application(), AST_VECTOR_FREE, dialplan_msg_handler, msg_data_function, msg_function, msg_handlers, msg_handlers_lock, msg_techs, and msg_techs_lock.
Referenced by ast_msg_init().
|
static |
Definition at line 570 of file main/message.c.
References ao2_alloc, ao2_ref, ast_string_field_init, msg_data_destructor(), and NULL.
Referenced by msg_set_var_full().
|
static |
Definition at line 412 of file main/message.c.
References CMP_MATCH, CMP_STOP, and msg_data::name.
Referenced by ast_msg_alloc().
|
static |
Definition at line 418 of file main/message.c.
References ast_string_field_free_memory.
Referenced by msg_data_alloc().
|
static |
Definition at line 586 of file main/message.c.
References ao2_find, name, OBJ_POINTER, and tmp().
Referenced by ast_msg_get_var(), and msg_set_var_full().
|
static |
Definition at line 1117 of file main/message.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_copy_string(), ast_log, ast_msg_get_var(), buf, ast_datastore::data, len(), LOG_ERROR, LOG_WARNING, msg_datastore, and NULL.
|
static |
Definition at line 1153 of file main/message.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_channel_lock, ast_channel_unlock, ast_log, ast_msg_set_var_outbound(), ast_datastore::data, LOG_WARNING, msg_datastore_find_or_create(), and value.
|
static |
Definition at line 994 of file main/message.c.
References ast_channel_datastore_add(), ast_channel_datastore_find(), ast_datastore_alloc, ast_datastore_free(), ast_msg_alloc(), ast_datastore::data, msg_datastore, and NULL.
Referenced by msg_data_func_write(), and msg_func_write().
|
static |
Definition at line 424 of file main/message.c.
References ao2_cleanup, ast_string_field_free_memory, and ast_msg::vars.
Referenced by ast_msg_alloc().
|
static |
Definition at line 405 of file main/message.c.
References ao2_ref.
|
static |
Definition at line 1196 of file main/message.c.
References AST_VECTOR_GET, AST_VECTOR_SIZE, current, msg_techs, and NULL.
Referenced by action_messagesend(), ast_msg_send(), ast_msg_tech_register(), and msg_send_exec().
|
static |
Definition at line 1016 of file main/message.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_copy_string(), ast_log, ast_msg::body, buf, ast_datastore::data, ast_msg::from, len(), LOG_ERROR, LOG_WARNING, msg_datastore, NULL, and ast_msg::to.
|
static |
Definition at line 1057 of file main/message.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_channel_lock, ast_channel_unlock, ast_log, ast_msg_set_body(), ast_msg_set_from(), ast_msg_set_to(), ast_datastore::data, LOG_WARNING, msg_datastore_find_or_create(), msg_data::send, value, and ast_msg::vars.
|
static |
Comparison callback for ast_msg_handler
vector removal.
vec_elem | The element in the vector being compared |
srch | The element being looked up |
non-zero | The items are equal |
0 | The items are not equal |
Definition at line 1694 of file main/message.c.
References ast_msg_handler::name.
Referenced by ast_msg_handler_unregister().
|
static |
Definition at line 1222 of file main/message.c.
References AST_VECTOR_GET, AST_VECTOR_SIZE, current, msg_handlers, and NULL.
Referenced by ast_msg_handler_register().
|
static |
Definition at line 921 of file main/message.c.
References ao2_ref, ast_debug, ast_log, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_msg::from, handler(), LOG_WARNING, msg_handlers, msg_handlers_lock, S_OR, and ast_msg::to.
Referenced by ast_msg_queue().
|
static |
Definition at line 770 of file main/message.c.
References ast_explicit_goto(), ast_pbx_run_args(), ast_msg::context, ast_msg::exten, ast_pbx_args::no_hangup_chan, and S_OR.
Referenced by dialplan_handle_msg_cb().
|
static |
Definition at line 1241 of file main/message.c.
References ao2_lock, ao2_ref, ao2_unlock, args, AST_APP_ARG, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, AST_DECLARE_APP_ARGS, ast_log, ast_rwlock_rdlock, ast_rwlock_unlock, AST_STANDARD_APP_ARGS, ast_strdupa, ast_string_field_set, ast_strlen_zero(), ast_datastore::data, LOG_WARNING, msg_datastore, msg_find_by_tech_name(), ast_msg_tech::msg_send, msg_tech, msg_techs_lock, NULL, pbx_builtin_setvar_helper(), S_OR, and strsep().
Referenced by ast_msg_init().
|
static |
Definition at line 594 of file main/message.c.
References ao2_link, ao2_ref, ao2_unlink, ast_string_field_set, ast_strlen_zero(), msg_data::msg, msg_data_alloc(), msg_data_find(), name, msg_data::send, value, and ast_msg::vars.
Referenced by ast_msg_set_var(), and ast_msg_set_var_outbound().
|
static |
Comparison callback for ast_msg_tech
vector removal.
vec_elem | The element in the vector being compared |
srch | The element being looked up |
non-zero | The items are equal |
0 | The items are not equal |
Definition at line 1633 of file main/message.c.
References ast_msg_tech::name.
Referenced by ast_msg_tech_unregister().
|
static |
Definition at line 282 of file main/message.c.
Referenced by ast_msg_init(), and message_shutdown().
size_t current |
Definition at line 272 of file main/message.c.
Referenced by msg_find_by_tech_name(), and msg_handler_find_by_tech_name().
|
static |
Definition at line 906 of file main/message.c.
Referenced by ast_msg_init(), and message_shutdown().
const struct ast_msg_handler* * elems |
Definition at line 272 of file main/message.c.
size_t max |
Definition at line 272 of file main/message.c.
|
static |
Definition at line 328 of file main/message.c.
Referenced by create_msg_q_chan().
|
static |
Definition at line 307 of file main/message.c.
Referenced by ast_msg_init(), and message_shutdown().
|
static |
Definition at line 286 of file main/message.c.
Referenced by chan_cleanup(), create_msg_q_chan(), dialplan_handle_msg_cb(), msg_data_func_read(), msg_datastore_find_or_create(), msg_func_read(), and msg_send_exec().
|
static |
Definition at line 296 of file main/message.c.
Referenced by ast_msg_init(), and message_shutdown().
struct { ... } msg_handlers |
Vector of received message handlers.
Referenced by ast_msg_handler_register(), ast_msg_handler_unregister(), ast_msg_has_destination(), ast_msg_init(), message_shutdown(), msg_handler_find_by_tech_name(), and msg_q_cb().
|
static |
Lock for msg_handlers
vector.
Definition at line 275 of file main/message.c.
Referenced by ast_msg_handler_register(), ast_msg_handler_unregister(), ast_msg_has_destination(), ast_msg_init(), message_shutdown(), and msg_q_cb().
|
static |
Definition at line 863 of file main/message.c.
Referenced by dialplan_handle_msg_cb().
|
static |
Definition at line 280 of file main/message.c.
Referenced by ast_msg_init(), ast_msg_queue(), and ast_msg_shutdown().
struct { ... } msg_techs |
Vector of message technologies.
Referenced by ast_msg_init(), ast_msg_tech_register(), ast_msg_tech_unregister(), message_shutdown(), and msg_find_by_tech_name().
|
static |
Lock for msg_techs
vector.
Definition at line 269 of file main/message.c.
Referenced by action_messagesend(), ast_msg_init(), ast_msg_send(), ast_msg_tech_register(), ast_msg_tech_unregister(), message_shutdown(), and msg_send_exec().