147 .
type =
"after-bridge-cb",
171 return datastore->
data;
192 return datastore->
data;
200 after_bridge =
ast_calloc(1,
sizeof(*after_bridge));
206 datastore->
data = after_bridge;
209 return datastore->
data;
280 if (last_node && !last_node->
reason) {
292 return "Channel destroyed (hungup)";
294 return "Callback was replaced";
296 return "Channel masqueraded";
298 return "Channel was departed from bridge";
300 return "Callback was removed";
302 return "Channel failed joining the bridge";
355 .
type =
"after-bridge-goto",
398 char *current_pos = buffer;
399 size_t remaining_size = buf_size;
409 after_bridge = datastore->
data;
417 snprintf(current_pos, remaining_size,
"%s,", after_bridge->
context);
418 remaining_size = remaining_size - strlen(current_pos);
419 current_pos += strlen(current_pos);
423 snprintf(current_pos, remaining_size,
"h,");
424 remaining_size = remaining_size - strlen(current_pos);
425 current_pos += strlen(current_pos);
427 snprintf(current_pos, remaining_size,
"%s,", after_bridge->
exten);
428 remaining_size = remaining_size - strlen(current_pos);
429 current_pos += strlen(current_pos);
432 snprintf(current_pos, remaining_size,
"%d", after_bridge->
priority);
439 int goto_failed = -1;
462 after_bridge = datastore->
data;
467 ast_debug(1,
"Running after bridge goto h exten %s,h,1\n",
512 ast_debug(1,
"Setup after bridge goto location to %s,%s,%d.\n",
584 after_bridge =
ast_calloc(1,
sizeof(*after_bridge));
597 datastore->
data = after_bridge;
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
void ast_bridge_discard_after_callback(struct ast_channel *chan, enum ast_bridge_after_cb_reason reason)
Run discarding any after bridge callbacks.
static void __after_bridge_set_goto(struct ast_channel *chan, int run_h_exten, int specific, const char *context, const char *exten, int priority, const char *parseable_goto)
void ast_bridge_run_after_goto(struct ast_channel *chan)
Run a PBX on any after bridge goto location.
static struct after_bridge_cb_ds * after_bridge_cb_find(struct ast_channel *chan)
static void after_bridge_cb_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
static void after_bridge_cb_run_discard(struct after_bridge_cb_ds *after_bridge, enum ast_bridge_after_cb_reason reason)
static struct ast_datastore * after_bridge_goto_remove(struct ast_channel *chan)
static const struct ast_datastore_info after_bridge_cb_info
int ast_bridge_setup_after_goto(struct ast_channel *chan)
Setup any after bridge goto location to begin execution.
static void after_bridge_cb_destroy(void *data)
void ast_bridge_run_after_callback(struct ast_channel *chan)
Run any after bridge callback.
void ast_bridge_discard_after_goto(struct ast_channel *chan)
Discard channel after bridge goto location.
int ast_bridge_set_after_callback(struct ast_channel *chan, ast_bridge_after_cb callback, ast_bridge_after_cb_failed failed, void *data)
Setup an after bridge callback for when the channel leaves the bridging system.
void ast_bridge_read_after_goto(struct ast_channel *chan, char *buffer, size_t buf_size)
Read after bridge goto if it exists.
static void after_bridge_goto_destroy(void *data)
static struct after_bridge_cb_ds * after_bridge_cb_setup(struct ast_channel *chan)
void ast_bridge_set_after_go_on(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *parseable_goto)
Set channel to go on in the dialplan after the bridge.
static void after_bridge_goto_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
void ast_bridge_set_after_goto(struct ast_channel *chan, const char *context, const char *exten, int priority)
Set channel to goto specific location after the bridge.
void ast_bridge_set_after_h(struct ast_channel *chan, const char *context)
Set channel to run the h exten after the bridge.
static const struct ast_datastore_info after_bridge_goto_info
const char * ast_bridge_after_cb_reason_string(enum ast_bridge_after_cb_reason reason)
Get a string representation of an after bridge callback reason.
static void after_bridge_cb_failed(struct after_bridge_cb_node *node)
After Bridge Execution API.
ast_bridge_after_cb_reason
@ AST_BRIDGE_AFTER_CB_REASON_IMPART_FAILED
@ AST_BRIDGE_AFTER_CB_REASON_REMOVED
@ AST_BRIDGE_AFTER_CB_REASON_DEPART
@ AST_BRIDGE_AFTER_CB_REASON_MASQUERADE
@ AST_BRIDGE_AFTER_CB_REASON_DESTROY
@ AST_BRIDGE_AFTER_CB_REASON_REPLACED
void(* ast_bridge_after_cb)(struct ast_channel *chan, void *data)
After bridge callback function.
void(* ast_bridge_after_cb_failed)(enum ast_bridge_after_cb_reason reason, void *data)
After bridge callback failed.
General Asterisk PBX channel definitions.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
void ast_channel_clear_flag(struct ast_channel *chan, unsigned int flag)
Clear a flag on a channel.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
void ast_channel_clear_softhangup(struct ast_channel *chan, int flag)
Clear a set of softhangup flags from a channel.
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
#define ast_channel_lock(chan)
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
int ast_channel_priority(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
void ast_channel_set_unbridged(struct ast_channel *chan, int value)
Sets the unbridged flag and queues a NULL frame on the channel to trigger a check by bridge_channel_w...
@ AST_SOFTHANGUP_ASYNCGOTO
void ast_channel_context_set(struct ast_channel *chan, const char *value)
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
void ast_channel_priority_set(struct ast_channel *chan, int value)
const char * ast_channel_exten(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
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.
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
#define AST_LIST_HEAD_DESTROY(head)
Destroys a list head structure.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_HEAD_INIT(head)
Initializes a list head structure.
#define AST_LIST_LOCK(head)
Locks a list.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
#define AST_LIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
Core PBX routines and definitions.
enum ast_pbx_result ast_pbx_run(struct ast_channel *c)
Execute the PBX in the current thread.
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
int ast_goto_if_exists(struct ast_channel *chan, const char *context, const char *exten, int priority)
void ast_pbx_h_exten_run(struct ast_channel *chan, const char *context)
Run the h exten from the given context.
int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority)
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
static force_inline int attribute_pure ast_strlen_zero(const char *s)
struct after_bridge_cb_ds::@311 callbacks
enum ast_bridge_after_cb_reason reason
struct after_bridge_cb_node::@310 list
ast_bridge_after_cb_failed failed
ast_bridge_after_cb callback
const char * parseable_goto
Main Channel structure associated with a channel.
Structure for a data store type.
Structure for a data store object.
#define ast_test_flag(p, flag)
void ast_replace_subargument_delimiter(char *s)
Replace '^' in a string with ','.