282 static const
char app_msg_send[] = "MessageSend";
284 static
void msg_ds_destroy(
void *data);
288 .destroy = msg_ds_destroy,
291 static int msg_func_read(
struct ast_channel *chan,
const char *
function,
292 char *data,
char *buf,
size_t len);
293 static int msg_func_write(
struct ast_channel *chan,
const char *
function,
294 char *data,
const char *value);
298 .read = msg_func_read,
299 .write = msg_func_write,
302 static int msg_data_func_read(
struct ast_channel *chan,
const char *
function,
303 char *data,
char *buf,
size_t len);
304 static int msg_data_func_write(
struct ast_channel *chan,
const char *
function,
305 char *data,
const char *value);
308 .
name =
"MESSAGE_DATA",
309 .read = msg_data_func_read,
310 .write = msg_data_func_write,
315 static int chan_msg_indicate(
struct ast_channel *chan,
int condition,
317 static int chan_msg_send_digit_begin(
struct ast_channel *chan,
char digit);
318 static int chan_msg_send_digit_end(
struct ast_channel *chan,
char digit,
319 unsigned int duration);
330 .description =
"Internal Text Message Processing",
331 .read = chan_msg_read,
332 .write = chan_msg_write,
333 .indicate = chan_msg_indicate,
334 .send_digit_begin = chan_msg_send_digit_begin,
335 .send_digit_end = chan_msg_send_digit_end,
372 static int chan_msg_indicate(
struct ast_channel *chan,
int condition,
386 static int chan_msg_send_digit_begin(
struct ast_channel *chan,
char digit)
399 static int chan_msg_send_digit_end(
struct ast_channel *chan,
char digit,
400 unsigned int duration)
405 static void msg_ds_destroy(
void *
data)
412 static int msg_data_cmp_fn(
void *obj,
void *arg,
int flags)
414 const struct msg_data *one = obj, *two = arg;
418 static void msg_data_destructor(
void *obj)
424 static void msg_destructor(
void *obj)
429 ao2_cleanup(msg->
vars);
436 if (!(msg = ao2_alloc(
sizeof(*msg), msg_destructor))) {
446 NULL, msg_data_cmp_fn);
570 static struct msg_data *msg_data_alloc(
void)
574 if (!(data = ao2_alloc(
sizeof(*data), msg_data_destructor))) {
594 static int msg_set_var_full(
struct ast_msg *msg,
const char *name,
const char *value,
unsigned int outbound)
598 if (!(data = msg_data_find(msg->
vars, name))) {
599 if (ast_strlen_zero(value)) {
602 if (!(data = msg_data_alloc())) {
608 data->send = outbound;
611 if (ast_strlen_zero(value)) {
615 data->send = outbound;
626 return msg_set_var_full(msg, name, value, 1);
631 return msg_set_var_full(msg, name, value, 0);
637 const char *
val = NULL;
639 if (!(data = msg_data_find(msg->
vars, name))) {
672 static int ast_msg_var_iterator_get_next(
const struct ast_msg *msg,
683 while ((data = ao2_iterator_next(&iter->iter)) && (data->send != send)) {
691 if (data->send == send) {
693 *value = data->value;
698 iter->current_used = data;
705 return ast_msg_var_iterator_get_next(msg, iter, name, value, 1);
711 return ast_msg_var_iterator_get_next(msg, iter, name, value, 0);
716 ao2_cleanup(iter->current_used);
717 iter->current_used = NULL;
736 NULL, NULL, NULL, NULL, 0,
737 "%s",
"Message/ast_msg_queue");
743 if (ast_opt_hide_messaging_ami_events) {
747 ast_channel_tech_set(chan, &msg_chan_tech_hack);
748 ast_channel_unlock(chan);
751 if (!(ds = ast_datastore_alloc(&msg_datastore, NULL))) {
756 ast_channel_lock(chan);
758 ast_channel_unlock(chan);
776 memset(&pbx_args, 0,
sizeof(pbx_args));
777 pbx_args.no_hangup_chan = 1,
795 ast_channel_lock(chan);
817 headp = ast_channel_varshead(chan);
819 ast_var_delete(vardata);
847 ast_channel_internal_alert_flush(chan);
849 ast_channel_unlock(chan);
852 static void destroy_msg_q_chan(
void *data)
866 static int dialplan_handle_msg_cb(
struct ast_msg *msg)
875 if (!(*chan_p = create_msg_q_chan())) {
881 ast_channel_lock(chan);
883 ast_channel_unlock(chan);
888 ast_channel_unlock(chan);
890 msg_route(chan, msg);
897 static int dialplan_has_destination_cb(
const struct ast_msg *msg)
899 if (ast_strlen_zero(msg->
context)) {
908 .handle_msg = dialplan_handle_msg_cb,
909 .has_destination = dialplan_has_destination_cb,
921 static int msg_q_cb(
void *data)
932 ast_debug(5,
"Handler %s doesn't want message, moving on\n", handler->
name);
936 ast_debug(5,
"Dispatching message to %s handler\n", handler->
name);
942 ast_log(LOG_WARNING,
"No handler processed message from %s to %s\n",
960 ast_debug(5,
"Seeing if %s can handle message\n", handler->
name);
1002 if (!(ds = ast_datastore_alloc(&msg_datastore, NULL))) {
1016 static int msg_func_read(
struct ast_channel *chan,
const char *
function,
1017 char *data,
char *buf,
size_t len)
1023 ast_log(LOG_WARNING,
"No channel was provided to %s function.\n",
function);
1027 ast_channel_lock(chan);
1030 ast_channel_unlock(chan);
1031 ast_log(LOG_ERROR,
"No MESSAGE data found on the channel to read.\n");
1037 ast_channel_unlock(chan);
1041 if (!strcasecmp(data,
"to")) {
1043 }
else if (!strcasecmp(data,
"from")) {
1045 }
else if (!strcasecmp(data,
"body")) {
1048 ast_log(LOG_WARNING,
"Invalid argument to MESSAGE(): '%s'\n", data);
1057 static int msg_func_write(
struct ast_channel *chan,
const char *
function,
1058 char *data,
const char *value)
1064 ast_log(LOG_WARNING,
"No channel was provided to %s function.\n",
function);
1068 ast_channel_lock(chan);
1070 if (!(ds = msg_datastore_find_or_create(chan))) {
1071 ast_channel_unlock(chan);
1077 ast_channel_unlock(chan);
1081 if (!strcasecmp(data,
"to")) {
1083 }
else if (!strcasecmp(data,
"from")) {
1085 }
else if (!strcasecmp(data,
"body")) {
1087 }
else if (!strcasecmp(data,
"custom_data")) {
1089 if (!strcasecmp(value,
"mark_all_outbound")) {
1091 }
else if (!strcasecmp(value,
"clear_all_outbound")) {
1094 ast_log(LOG_WARNING,
"'%s' is not a valid value for custom_data\n", value);
1097 if (outbound != -1) {
1101 while ((hdr_data = ao2_iterator_next(&iter))) {
1102 hdr_data->send = outbound;
1108 ast_log(LOG_WARNING,
"'%s' is not a valid write argument.\n", data);
1117 static int msg_data_func_read(
struct ast_channel *chan,
const char *
function,
1118 char *data,
char *buf,
size_t len)
1125 ast_log(LOG_WARNING,
"No channel was provided to %s function.\n",
function);
1129 ast_channel_lock(chan);
1132 ast_channel_unlock(chan);
1133 ast_log(LOG_ERROR,
"No MESSAGE data found on the channel to read.\n");
1139 ast_channel_unlock(chan);
1153 static int msg_data_func_write(
struct ast_channel *chan,
const char *
function,
1154 char *data,
const char *value)
1160 ast_log(LOG_WARNING,
"No channel was provided to %s function.\n",
function);
1164 ast_channel_lock(chan);
1166 if (!(ds = msg_datastore_find_or_create(chan))) {
1167 ast_channel_unlock(chan);
1173 ast_channel_unlock(chan);
1196 static const struct ast_msg_tech *msg_find_by_tech_name(
const char *tech_name)
1203 if (!strcmp(current->
name, tech_name)) {
1222 static const struct ast_msg_handler *msg_handler_find_by_tech_name(
const char *tech_name)
1229 if (!strcmp(current->
name, tech_name)) {
1241 static int msg_send_exec(
struct ast_channel *chan,
const char *data)
1255 if (ast_strlen_zero(data)) {
1256 ast_log(LOG_WARNING,
"An argument is required to MessageSend()\n");
1264 if (ast_strlen_zero(args.destination)) {
1265 ast_log(LOG_WARNING,
"A 'to' URI is required for MessageSend()\n");
1270 ast_channel_lock(chan);
1273 ast_channel_unlock(chan);
1274 ast_log(LOG_WARNING,
"No message data found on channel to send.\n");
1281 ast_channel_unlock(chan);
1284 tech_name = strsep(&tech_name,
":");
1286 ast_rwlock_rdlock(&msg_techs_lock);
1287 msg_tech = msg_find_by_tech_name(tech_name);
1290 ast_log(LOG_WARNING,
"No message technology '%s' found.\n", tech_name);
1299 if (!ast_strlen_zero(args.to)) {
1309 res = msg_tech->
msg_send(msg,
S_OR(args.destination,
""),
S_OR(args.from,
""));
1315 ast_rwlock_unlock(&msg_techs_lock);
1328 const char *to_override = NULL;
1329 char base64decoded[1301] = { 0, };
1330 char *tech_name = NULL;
1337 if (!ast_strlen_zero(destination)) {
1338 if (!ast_strlen_zero(to)) {
1343 if (ast_strlen_zero(to)) {
1349 if (!ast_strlen_zero(base64body)) {
1350 ast_base64decode((
unsigned char *) base64decoded, base64body,
sizeof(base64decoded) - 1);
1351 body = base64decoded;
1355 tech_name = strsep(&tech_name,
":");
1357 ast_rwlock_rdlock(&msg_techs_lock);
1358 msg_tech = msg_find_by_tech_name(tech_name);
1360 ast_rwlock_unlock(&msg_techs_lock);
1366 ast_rwlock_unlock(&msg_techs_lock);
1372 for (vars = data;
vars; vars = vars->
next) {
1384 ast_rwlock_unlock(&msg_techs_lock);
1399 char *tech_name = NULL;
1403 if (ast_strlen_zero(to)) {
1409 tech_name = strsep(&tech_name,
":");
1411 ast_rwlock_rdlock(&msg_techs_lock);
1412 msg_tech = msg_find_by_tech_name(tech_name);
1415 ast_log(LOG_ERROR,
"Unknown message tech: %s\n", tech_name);
1416 ast_rwlock_unlock(&msg_techs_lock);
1422 ast_rwlock_unlock(&msg_techs_lock);
1437 enum ast_msg_data_source_type source;
1444 #define ATTRIBUTE_UNSET -1
1450 size_t len =
sizeof(*msg);
1452 size_t current_offset = 0;
1453 enum ast_msg_data_attribute_type attr_type;
1456 ast_assert(attributes != NULL);
1461 ast_assert(count > 0);
1466 for (i=0; i < count; i++) {
1467 if (!attributes[i].value) {
1468 ast_assert(attributes[i].value != NULL);
1471 len += (strlen(attributes[i].value) + 1);
1478 msg->source = source;
1482 for (attr_type = 0; attr_type < __AST_MSG_DATA_ATTR_LAST; attr_type++) {
1487 for (i=0; i < count; i++) {
1488 len = (strlen(attributes[i].value) + 1);
1491 current_offset += len;
1498 const char *to,
const char *from,
const char *content_type,
const char *body)
1503 .type = AST_MSG_DATA_ATTR_TO,
1504 .value = (
char *)
S_OR(to,
""),
1507 .type = AST_MSG_DATA_ATTR_FROM,
1508 .value = (
char *)
S_OR(from,
""),
1511 .type = AST_MSG_DATA_ATTR_CONTENT_TYPE,
1512 .value = (
char *)
S_OR(content_type,
""),
1515 .type = AST_MSG_DATA_ATTR_BODY,
1516 .value = (
char *)
S_OR(body,
""),
1528 ast_assert(msg != NULL);
1536 memcpy(dest, msg, msg->
length);
1544 ast_assert(msg != NULL);
1554 ast_assert(msg != NULL);
1555 return AST_MSG_DATA_SOURCE_TYPE_UNKNOWN;
1562 enum ast_msg_data_attribute_type attribute_type)
1565 ast_assert(msg != NULL);
1581 ast_assert(channel != NULL);
1586 ast_assert(msg != NULL);
1590 memset(&f, 0,
sizeof(f));
1601 ast_rwlock_wrlock(&msg_techs_lock);
1603 match = msg_find_by_tech_name(tech->
name);
1605 ast_log(LOG_ERROR,
"Message technology already registered for '%s'\n",
1607 ast_rwlock_unlock(&msg_techs_lock);
1612 ast_log(LOG_ERROR,
"Failed to register message technology for '%s'\n",
1614 ast_rwlock_unlock(&msg_techs_lock);
1617 ast_verb(5,
"Message technology '%s' registered.\n", tech->
name);
1619 ast_rwlock_unlock(&msg_techs_lock);
1635 return !strcmp(vec_elem->
name, srch->
name);
1642 ast_rwlock_wrlock(&msg_techs_lock);
1645 ast_rwlock_unlock(&msg_techs_lock);
1648 ast_log(LOG_ERROR,
"No '%s' message technology found.\n", tech->
name);
1652 ast_verb(5,
"Message technology '%s' unregistered.\n", tech->
name);
1663 match = msg_handler_find_by_tech_name(handler->
name);
1665 ast_log(LOG_ERROR,
"Message handler already registered for '%s'\n",
1672 ast_log(LOG_ERROR,
"Failed to register message handler for '%s'\n",
1677 ast_verb(5,
"Message handler '%s' registered.\n", handler->
name);
1696 return !strcmp(vec_elem->
name, srch->
name);
1709 ast_log(LOG_ERROR,
"No '%s' message handler found.\n", handler->
name);
1713 ast_verb(5,
"Message handler '%s' unregistered.\n", handler->
name);
1732 static void message_shutdown(
void)
1742 ast_rwlock_destroy(&msg_techs_lock);
size_t ast_msg_data_get_length(struct ast_msg_data *msg)
Get length of the structure.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
struct ast_variable * next
int ast_msg_set_exten(struct ast_msg *msg, const char *fmt,...)
Set the dialplan extension for this message.
Options for ast_pbx_run()
Main Channel structure associated with a channel.
Channels with this particular technology are an implementation detail of Asterisk and should generall...
Asterisk main include file. File version handling, generic pbx functions.
enum ast_msg_data_source_type ast_msg_data_get_source_type(struct ast_msg_data *msg)
Get "source type" from ast_msg_data.
struct ast_msg_var_iterator * ast_msg_var_iterator_init(const struct ast_msg *msg)
Create a new message variable iterator.
struct ast_msg * ast_msg_ref(struct ast_msg *msg)
Bump a msg's ref count.
void ast_msg_var_unref_current(struct ast_msg_var_iterator *iter)
Unref a message var from inside an iterator loop.
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
int(*const handle_msg)(struct ast_msg *msg)
The function callback that will handle the message.
void ast_msg_var_iterator_destroy(struct ast_msg_var_iterator *iter)
Destroy a message variable iterator.
String manipulation functions.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
struct ast_msg_data * ast_msg_data_dup(struct ast_msg_data *msg)
Clone an ast_msg_data structure.
int ast_msg_tech_unregister(const struct ast_msg_tech *tech)
Unregister a message technology.
#define AST_VECTOR_REMOVE_CMP_UNORDERED(vec, value, cmp, cleanup)
Remove an element from a vector that matches the given comparison.
int ast_msg_tech_register(const struct ast_msg_tech *tech)
Register a message technology.
struct ast_msg * ast_msg_destroy(struct ast_msg *msg)
Destroy an ast_msg.
An external processor of received messages.
const char * ast_msg_get_to(const struct ast_msg *msg)
Retrieve the destination of this message.
struct ast_channel * ast_channel_release(struct ast_channel *chan)
Unlink and release reference to a channel.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define ast_rwlock_init(rwlock)
wrapper for rwlock with tracking enabled
struct ast_taskprocessor * ast_taskprocessor_get(const char *name, enum ast_tps_options create)
Get a reference to a taskprocessor with the specified name and create the taskprocessor if necessary...
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)
Allocate and initialize a list container.
const ast_string_field to
Structure for variables, used for configurations and for channel variables.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
return a reference to a taskprocessor, create one if it does not exist
struct @378 msg_handlers
Vector of received message handlers.
const char *const name
Name of this message technology.
Structure for a data store type.
Structure used to transport a message through the frame core.
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.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
const ast_string_field endpoint
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority)
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.
static ast_rwlock_t msg_techs_lock
Lock for msg_techs vector.
void astman_send_ack(struct mansession *s, const struct message *m, char *msg)
Send ack in manager transaction.
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 ast_msg_set_to(struct ast_msg *msg, const char *fmt,...)
Set the 'to' URI of a message.
Structure for a data store object.
int ast_msg_set_from(struct ast_msg *msg, const char *fmt,...)
Set the 'from' URI of a message.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
int(*const has_destination)(const struct ast_msg *msg)
Return whether or not the message has a valid destination.
#define ast_manager_register_xml_core(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
Out-of-call text message support.
int ast_msg_handler_unregister(const struct ast_msg_handler *handler)
Unregister a ast_msg_handler.
int ast_unregister_application(const char *app)
Unregister an application.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
const ast_string_field exten
const char * astman_get_header(const struct message *m, char *var)
Get header from manager transaction.
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.
Asterisk datastore objects.
int ast_msg_handler_register(const struct ast_msg_handler *handler)
Register a ast_msg_handler.
int ast_base64decode(unsigned char *dst, const char *src, int max)
Decode data from base64.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
struct ao2_container * vars
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
void ast_channel_clear_softhangup(struct ast_channel *chan, int flag)
Clear a set of softhangup flags from a channel.
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Data structure associated with a custom dialplan function.
enum ast_pbx_result ast_pbx_run_args(struct ast_channel *c, struct ast_pbx_args *args)
Execute the PBX in the current thread.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
const ast_string_field body
#define AST_STRING_FIELD(name)
Declare a string field.
struct @377 msg_techs
Vector of message technologies.
const char * ast_msg_get_tech(const struct ast_msg *msg)
Retrieve the technology associated with this message.
In case you didn't read that giant block of text above the mansession_session struct, the mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data.
#define ast_malloc(len)
A wrapper for malloc()
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_VECTOR(name, type)
Define a vector structure.
const char * ast_msg_get_var(struct ast_msg *msg, const char *name)
Get the specified variable on the message.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Core PBX routines and definitions.
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
const char * ast_msg_get_endpoint(const struct ast_msg *msg)
Retrieve the endpoint associated with this message.
void ast_msg_shutdown(void)
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.
int ast_manager_unregister(const char *action)
Unregister a registered manager command.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
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.
struct ast_msg * ast_msg_alloc(void)
Allocate 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.
int attribute_value_offsets[__AST_MSG_DATA_ATTR_LAST]
#define ao2_unlink(container, obj)
Remove an object from a container.
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.
int ast_msg_set_body(struct ast_msg *msg, const char *fmt,...)
Set the 'body' text of a message (in UTF-8)
union ast_frame::@224 data
int ast_msg_set_endpoint(struct ast_msg *msg, const char *fmt,...)
Set the technology's endpoint associated with this message.
#define ast_calloc(num, len)
A wrapper for calloc()
const ast_string_field from
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
Prototypes for public functions only of internal interest,.
Vector container support.
An API for managing task processing threads that can be shared across modules.
int ast_msg_set_tech(struct ast_msg *msg, const char *fmt,...)
Set the technology associated with this message.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
#define AST_THREADSTORAGE_CUSTOM(a, b, c)
Define a thread storage variable, with custom initialization and cleanup.
const char * name
Name of the message handler.
struct ast_frame ast_null_frame
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
A ast_taskprocessor structure is a singleton by name.
int ast_taskprocessor_push(struct ast_taskprocessor *tps, int(*task_exe)(void *datap), void *datap) attribute_warn_unused_result
Push a task into the specified taskprocessor queue and signal the taskprocessor thread.
struct ast_variable * astman_get_variables_order(const struct message *m, enum variable_orders order)
Get a linked list of the Variable: headers with order specified.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Structure for rwlock and tracking information.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
void * ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
Unreference the specified taskprocessor and its reference count will decrement.
static ast_rwlock_t msg_handlers_lock
Lock for msg_handlers vector.
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.
const char * ast_msg_get_body(const struct ast_msg *msg)
Get the body of a message.
Data structure associated with a single frame of data.
int __ast_custom_function_register(struct ast_custom_function *acf, struct ast_module *mod)
Register a custom function.
int ast_msg_set_context(struct ast_msg *msg, const char *fmt,...)
Set the dialplan context for this message.
int ast_register_application2(const char *app, int(*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod)
Register an application.
const ast_string_field context
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.
enum ast_frame_type frametype
int(*const msg_send)(const struct ast_msg *msg, const char *to, const char *from)
Send a message.
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
void astman_send_error(struct mansession *s, const struct message *m, char *error)
Send error in manager transaction.
Asterisk module definitions.
int ast_msg_has_destination(const struct ast_msg *msg)
Determine if a particular message has a destination via some handler.
int ast_msg_send(struct ast_msg *msg, const char *to, const char *from)
Send a msg directly to an endpoint.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
const ast_string_field tech
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
void ast_channel_unlink(struct ast_channel *chan)
Remove a channel from the global channels container.
#define ast_string_field_build_va(x, field, fmt, args)
Set a field to a complex (built) value.
#define AST_APP_ARG(name)
Define an application argument.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ao2_link(container, obj)
Add an object to a container.