Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Basic bridge subclass API. More...
Go to the source code of this file.
Macros | |
#define | AST_TRANSFERER_ROLE_NAME "transferer" |
Functions | |
struct ast_bridge * | ast_bridge_basic_new (void) |
Create a new basic class bridge. More... | |
void | ast_bridge_basic_set_flags (struct ast_bridge *bridge, unsigned int flags) |
Set feature flags on a basic bridge. More... | |
int | ast_bridge_features_ds_append (struct ast_channel *chan, struct ast_flags *flags) |
Append basic bridge DTMF feature flags on the channel. More... | |
struct ast_flags * | ast_bridge_features_ds_get (struct ast_channel *chan) |
Get DTMF feature flags from the channel. More... | |
int | ast_bridge_features_ds_get_string (struct ast_channel *chan, char *buffer, size_t buf_size) |
writes a channel's DTMF features to a buffer string More... | |
int | ast_bridge_features_ds_set (struct ast_channel *chan, struct ast_flags *flags) |
Set basic bridge DTMF feature flags datastore on the channel. More... | |
int | ast_bridge_features_ds_set_string (struct ast_channel *chan, const char *features) |
Sets the features a channel will use upon being bridged. More... | |
void | ast_bridging_init_basic (void) |
Variables | |
struct ast_bridge_methods | ast_bridge_basic_v_table |
Bridge basic class virtual method table. More... | |
#define AST_TRANSFERER_ROLE_NAME "transferer" |
Definition at line 36 of file bridge_basic.h.
struct ast_bridge * ast_bridge_basic_new | ( | void | ) |
Create a new basic class bridge.
NULL | on failure |
Example usage:
This creates a basic two party bridge with any configured DTMF features enabled that will be destroyed once one of the channels hangs up.
Definition at line 3661 of file bridge_basic.c.
References ast_bridge_basic_v_table, AST_BRIDGE_CAPABILITY_1TO1MIX, AST_BRIDGE_CAPABILITY_MULTIMIX, AST_BRIDGE_CAPABILITY_NATIVE, bridge_alloc(), bridge_base_init(), bridge_basic_personality_alloc(), bridge_register(), NORMAL_FLAGS, and NULL.
Referenced by action_bridge(), agent_request_exec(), ast_bridge_call_with_flags(), AST_TEST_DEFINE(), bridge_exec(), feature_attended_transfer(), and parked_call_app_exec().
void ast_bridge_basic_set_flags | ( | struct ast_bridge * | bridge, |
unsigned int | flags | ||
) |
Set feature flags on a basic bridge.
Using this function instead of setting flags directly will ensure that after operations such as an attended transfer, the bridge will maintain the flags that were set on it.
bridge | |
flags | These are added to the flags already set. |
Definition at line 3674 of file bridge_basic.c.
References ast_bridge_lock, ast_bridge_unlock, ast_set_flag, personality_details::bridge_flags, bridge_basic_personality::current, bridge_basic_personality::details, ast_bridge::feature_flags, lock, ast_bridge::personality, and SCOPED_LOCK.
Referenced by ast_bridge_call_with_flags().
int ast_bridge_features_ds_append | ( | struct ast_channel * | chan, |
struct ast_flags * | flags | ||
) |
Append basic bridge DTMF feature flags on the channel.
chan | Channel to append DTMF features datastore. |
flags | Builtin DTMF feature flags. (ast_bridge_config flags) |
0 | on success. |
-1 | on error. |
Definition at line 263 of file bridge_basic.c.
References bridge_features_ds_set_full(), and ast_flags::flags.
Referenced by pre_bridge_setup().
struct ast_flags * ast_bridge_features_ds_get | ( | struct ast_channel * | chan | ) |
Get DTMF feature flags from the channel.
chan | Channel to get DTMF features datastore. |
NULL | if the datastore does not exist. |
Definition at line 268 of file bridge_basic.c.
References ast_channel_datastore_find(), ast_datastore::data, dtmf_features_info, and NULL.
Referenced by ast_bridge_features_ds_get_string(), attended_transfer_properties_alloc(), parked_call_retrieve_enable_features(), and setup_bridge_features_builtin().
int ast_bridge_features_ds_get_string | ( | struct ast_channel * | chan, |
char * | buffer, | ||
size_t | buf_size | ||
) |
writes a channel's DTMF features to a buffer string
chan | channel whose feature flags should be checked |
buffer | pointer string buffer where the output should be stored |
buf_size | size of the provided buffer (ideally enough for all features, 6+) |
0 | on successful write |
-1 | on failure |
Definition at line 208 of file bridge_basic.c.
References ast_bridge_features_ds_get(), ast_channel_lock, ast_channel_unlock, and dtmf_features_flags_to_string().
Referenced by func_channel_read().
int ast_bridge_features_ds_set | ( | struct ast_channel * | chan, |
struct ast_flags * | flags | ||
) |
Set basic bridge DTMF feature flags datastore on the channel.
chan | Channel to set DTMF features datastore. |
flags | Builtin DTMF feature flags. (ast_bridge_config flags) |
0 | on success. |
-1 | on error. |
Definition at line 258 of file bridge_basic.c.
References bridge_features_ds_set_full(), and ast_flags::flags.
Referenced by ast_bridge_features_ds_set_string(), parked_call_retrieve_enable_features(), and recalling_exit().
int ast_bridge_features_ds_set_string | ( | struct ast_channel * | chan, |
const char * | features | ||
) |
Sets the features a channel will use upon being bridged.
chan | Which channel to set features for |
features | Which feature codes to set for the channel |
0 | on success |
-1 | on failure |
Definition at line 189 of file bridge_basic.c.
References ast_bridge_features_ds_set(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_log, build_dtmf_features(), ast_flags::flags, and LOG_ERROR.
Referenced by func_channel_write_real().
void ast_bridging_init_basic | ( | void | ) |
Initialize the basic bridge class for use by the system.
Definition at line 3683 of file bridge_basic.c.
References ast_bridge_base_v_table, ast_bridge_basic_v_table, AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER, AST_BRIDGE_BUILTIN_BLINDTRANSFER, ast_bridge_features_register(), bridge_basic_destroy(), bridge_basic_pull(), bridge_basic_push(), bridge_personality_atxfer_pull(), bridge_personality_atxfer_push(), bridge_personality_normal_push(), ast_bridge_methods::destroy, feature_attended_transfer(), feature_blind_transfer(), ast_bridge_methods::name, NULL, personality_atxfer_v_table, personality_normal_v_table, ast_bridge_methods::pull, and ast_bridge_methods::push.
Referenced by ast_bridging_init().
|
extern |
Bridge basic class virtual method table.
Definition at line 3570 of file bridge_basic.c.
Referenced by ast_bridge_basic_new(), and ast_bridging_init_basic().