Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
After Bridge Execution API. More...
#include "asterisk.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/bridge_after.h"
Go to the source code of this file.
Data Structures | |
struct | after_bridge_cb_ds |
struct | after_bridge_cb_node |
struct | after_bridge_goto_ds |
Functions | |
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) |
static void | after_bridge_cb_destroy (void *data) |
static void | after_bridge_cb_failed (struct after_bridge_cb_node *node) |
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 after_bridge_cb_ds * | after_bridge_cb_setup (struct ast_channel *chan) |
static void | after_bridge_goto_destroy (void *data) |
static void | after_bridge_goto_fixup (void *data, struct ast_channel *old_chan, struct ast_channel *new_chan) |
static struct ast_datastore * | after_bridge_goto_remove (struct ast_channel *chan) |
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. More... | |
void | ast_bridge_discard_after_callback (struct ast_channel *chan, enum ast_bridge_after_cb_reason reason) |
Run discarding any after bridge callbacks. More... | |
void | ast_bridge_discard_after_goto (struct ast_channel *chan) |
Discard channel after bridge goto location. More... | |
void | ast_bridge_read_after_goto (struct ast_channel *chan, char *buffer, size_t buf_size) |
Read after bridge goto if it exists. More... | |
void | ast_bridge_run_after_callback (struct ast_channel *chan) |
Run any after bridge callback. More... | |
void | ast_bridge_run_after_goto (struct ast_channel *chan) |
Run a PBX on any after bridge goto location. More... | |
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. More... | |
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. More... | |
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. More... | |
void | ast_bridge_set_after_h (struct ast_channel *chan, const char *context) |
Set channel to run the h exten after the bridge. More... | |
int | ast_bridge_setup_after_goto (struct ast_channel *chan) |
Setup any after bridge goto location to begin execution. More... | |
Variables | |
static const struct ast_datastore_info | after_bridge_cb_info |
static const struct ast_datastore_info | after_bridge_goto_info |
|
static |
Definition at line 557 of file bridge_after.c.
References after_bridge_goto_info, ast_assert, ast_bridge_discard_after_goto(), ast_calloc, ast_channel_datastore_add(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, ast_datastore_free(), ast_strdup, voicemailpwcheck::context, after_bridge_goto_ds::context, ast_datastore::data, after_bridge_goto_ds::exten, NULL, after_bridge_goto_ds::parseable_goto, priority, after_bridge_goto_ds::priority, after_bridge_goto_ds::run_h_exten, and after_bridge_goto_ds::specific.
Referenced by ast_bridge_set_after_go_on(), ast_bridge_set_after_goto(), and ast_bridge_set_after_h().
|
static |
Definition at line 107 of file bridge_after.c.
References after_bridge_cb_run_discard(), AST_BRIDGE_AFTER_CB_REASON_DESTROY, ast_free, AST_LIST_HEAD_DESTROY, and after_bridge_cb_ds::callbacks.
|
static |
Definition at line 65 of file bridge_after.c.
References NULL.
Referenced by after_bridge_cb_run_discard(), and ast_bridge_run_after_callback().
|
static |
Definition at line 162 of file bridge_after.c.
References after_bridge_cb_info, ast_channel_datastore_find(), ast_datastore::data, lock, NULL, and SCOPED_CHANNELLOCK.
Referenced by after_bridge_cb_fixup(), ast_bridge_discard_after_callback(), and ast_bridge_run_after_callback().
|
static |
Definition at line 128 of file bridge_after.c.
References after_bridge_cb_find(), AST_BRIDGE_AFTER_CB_REASON_MASQUERADE, AST_LIST_LAST, AST_LIST_LOCK, AST_LIST_UNLOCK, and after_bridge_cb_ds::callbacks.
|
static |
Definition at line 81 of file bridge_after.c.
References after_bridge_cb_failed(), ast_free, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, after_bridge_cb_ds::callbacks, after_bridge_cb_node::list, and after_bridge_cb_node::reason.
Referenced by after_bridge_cb_destroy(), and ast_bridge_discard_after_callback().
|
static |
Definition at line 184 of file bridge_after.c.
References after_bridge_cb_info, ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_datastore_alloc, ast_datastore_free(), AST_LIST_HEAD_INIT, after_bridge_cb_ds::callbacks, ast_datastore::data, lock, NULL, and SCOPED_CHANNELLOCK.
Referenced by ast_bridge_set_after_callback().
|
static |
Definition at line 329 of file bridge_after.c.
References ast_free, after_bridge_goto_ds::context, after_bridge_goto_ds::exten, and after_bridge_goto_ds::parseable_goto.
|
static |
Definition at line 348 of file bridge_after.c.
References ast_bridge_discard_after_goto().
|
static |
Definition at line 370 of file bridge_after.c.
References after_bridge_goto_info, ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, and NULL.
Referenced by ast_bridge_discard_after_goto(), and ast_bridge_setup_after_goto().
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.
reason | The reason to interpret to a string |
NULL | Unrecognized reason |
non-NULL | String representation of reason |
Definition at line 288 of file bridge_after.c.
References AST_BRIDGE_AFTER_CB_REASON_DEPART, AST_BRIDGE_AFTER_CB_REASON_DESTROY, AST_BRIDGE_AFTER_CB_REASON_IMPART_FAILED, AST_BRIDGE_AFTER_CB_REASON_MASQUERADE, AST_BRIDGE_AFTER_CB_REASON_REMOVED, AST_BRIDGE_AFTER_CB_REASON_REPLACED, and after_bridge_cb_node::reason.
Referenced by after_bridge_move_channel_fail(), agent_after_bridge_cb_failed(), bridge_after_cb_failed(), and internal_bridge_after_cb().
void ast_bridge_discard_after_callback | ( | struct ast_channel * | chan, |
enum ast_bridge_after_cb_reason | reason | ||
) |
Run discarding any after bridge callbacks.
chan | Channel to run after bridge callback. |
reason |
Definition at line 239 of file bridge_after.c.
References after_bridge_cb_find(), and after_bridge_cb_run_discard().
Referenced by ast_bridge_impart(), and bridge_channel_depart_thread().
void ast_bridge_discard_after_goto | ( | struct ast_channel * | chan | ) |
Discard channel after bridge goto location.
chan | Channel to discard after bridge goto location. |
Definition at line 384 of file bridge_after.c.
References after_bridge_goto_remove(), and ast_datastore_free().
Referenced by __after_bridge_set_goto(), after_bridge_goto_fixup(), bridge_channel_depart_thread(), feature_blind_transfer(), and func_channel_write_real().
void ast_bridge_read_after_goto | ( | struct ast_channel * | chan, |
char * | buffer, | ||
size_t | buf_size | ||
) |
Read after bridge goto if it exists.
chan | Channel to read the after bridge goto parseable goto string from |
buffer | Buffer to write the after bridge goto data to |
buf_size | size of the buffer being written to |
Definition at line 394 of file bridge_after.c.
References after_bridge_goto_info, ast_channel_datastore_find(), ast_strlen_zero(), after_bridge_goto_ds::context, ast_datastore::data, after_bridge_goto_ds::exten, lock, NULL, after_bridge_goto_ds::parseable_goto, after_bridge_goto_ds::priority, after_bridge_goto_ds::run_h_exten, and SCOPED_CHANNELLOCK.
Referenced by func_channel_read().
void ast_bridge_run_after_callback | ( | struct ast_channel * | chan | ) |
Run any after bridge callback.
chan | Channel to run after bridge callback. |
Definition at line 212 of file bridge_after.c.
References after_bridge_cb_failed(), after_bridge_cb_find(), ast_free, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, after_bridge_cb_ds::callbacks, after_bridge_cb_node::list, and NULL.
Referenced by ast_bridge_join(), and bridge_channel_ind_thread().
void ast_bridge_run_after_goto | ( | struct ast_channel * | chan | ) |
Run a PBX on any after bridge goto location.
chan | Channel to execute after bridge goto location. |
Pull off any after bridge goto location datastore and run a PBX at that location.
Definition at line 525 of file bridge_after.c.
References ast_bridge_setup_after_goto(), ast_hangup(), and ast_pbx_run().
Referenced by bridge_channel_ind_thread().
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.
chan | Channel to setup an after bridge callback on. |
callback | Function to call when the channel leaves the bridging system. |
failed | Function to call when it will not be calling the callback. |
data | Extra data to pass with the callback. |
0 | on success. |
-1 | on error. |
Definition at line 251 of file bridge_after.c.
References after_bridge_cb_setup(), ast_assert, AST_BRIDGE_AFTER_CB_REASON_REPLACED, ast_calloc, AST_LIST_INSERT_TAIL, AST_LIST_LAST, AST_LIST_LOCK, AST_LIST_UNLOCK, after_bridge_cb_node::callback, after_bridge_cb_ds::callbacks, after_bridge_cb_node::data, after_bridge_cb_node::failed, after_bridge_cb_node::list, NULL, and after_bridge_cb_node::reason.
Referenced by add_to_dial_bridge(), bridge_agent_hold_push(), bridge_channel_attended_transfer(), bridge_stasis_push(), control_swap_channel_in_bridge(), and stasis_app_bridge_playback_channel_add().
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.
chan | Channel to setup after bridge goto location. |
context | Current context of the caller channel. |
exten | Current exten of the caller channel. |
priority | Current priority of the caller channel |
parseable_goto | User specified goto string from dialplan. |
Add a channel datastore to setup the goto location when the channel leaves the bridge and run a PBX from there.
If parseable_goto then use the given context/exten/priority as the relative position for the parseable_goto. Else goto the given context/exten/priority+1.
Definition at line 622 of file bridge_after.c.
References __after_bridge_set_goto(), ast_replace_subargument_delimiter(), ast_strdupa, ast_strlen_zero(), voicemailpwcheck::context, after_bridge_goto_ds::exten, NULL, after_bridge_goto_ds::parseable_goto, and priority.
Referenced by bridge_exec(), feature_blind_transfer(), func_channel_write_real(), and setup_peer_after_bridge_goto().
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.
chan | Channel to setup after bridge goto location. |
context | Context to goto after bridge. |
exten | Exten to goto after bridge. |
priority | Priority to goto after bridge. |
Add a channel datastore to setup the goto location when the channel leaves the bridge and run a PBX from there.
Definition at line 612 of file bridge_after.c.
References __after_bridge_set_goto(), voicemailpwcheck::context, after_bridge_goto_ds::exten, NULL, and priority.
Referenced by action_bridge().
void ast_bridge_set_after_h | ( | struct ast_channel * | chan, |
const char * | context | ||
) |
Set channel to run the h exten after the bridge.
chan | Channel to setup after bridge goto location. |
context | Context to goto after bridge. |
Add a channel datastore to setup the goto location when the channel leaves the bridge and run a PBX from there.
Definition at line 617 of file bridge_after.c.
References __after_bridge_set_goto(), voicemailpwcheck::context, and NULL.
Referenced by setup_peer_after_bridge_goto().
int ast_bridge_setup_after_goto | ( | struct ast_channel * | chan | ) |
Setup any after bridge goto location to begin execution.
chan | Channel to setup after bridge goto location. |
Pull off any after bridge goto location datastore and setup for dialplan execution there.
0 | on success. The goto location is set for a PBX to run it. |
non-zero | on error or no goto location. |
Definition at line 435 of file bridge_after.c.
References after_bridge_goto_remove(), ast_channel_caller(), ast_channel_clear_flag(), ast_channel_clear_softhangup(), ast_channel_context(), ast_channel_context_set(), ast_channel_exten(), ast_channel_exten_set(), ast_channel_flags(), ast_channel_priority(), ast_channel_priority_set(), ast_channel_set_unbridged(), ast_channel_softhangup_internal_flag(), ast_check_hangup(), ast_datastore_free(), ast_debug, ast_exists_extension(), ast_explicit_goto(), AST_FLAG_IN_AUTOLOOP, AST_FLAG_OUTGOING, ast_goto_if_exists(), ast_parseable_goto(), ast_pbx_h_exten_run(), AST_SOFTHANGUP_ASYNCGOTO, ast_strdupa, ast_strlen_zero(), ast_test_flag, voicemailpwcheck::context, after_bridge_goto_ds::context, ast_datastore::data, after_bridge_goto_ds::exten, NULL, after_bridge_goto_ds::parseable_goto, priority, after_bridge_goto_ds::priority, after_bridge_goto_ds::run_h_exten, S_COR, and after_bridge_goto_ds::specific.
Referenced by app_control_dial(), ast_bridge_join(), ast_bridge_run_after_goto(), bridge_failed_peer_goto(), dial_exec_full(), and internal_bridge_after_cb().
|
static |
Definition at line 146 of file bridge_after.c.
Referenced by after_bridge_cb_find(), and after_bridge_cb_setup().
|
static |
Definition at line 354 of file bridge_after.c.
Referenced by __after_bridge_set_goto(), after_bridge_goto_remove(), and ast_bridge_read_after_goto().