Asterisk - The Open Source Telephony Project
18.5.0
|
Channel Bridging API. More...
#include "asterisk/channel.h"
Go to the source code of this file.
Data Structures | |
struct | ast_bridge_features |
Structure that contains features information. More... | |
struct | ast_bridge_features_attended_transfer |
Structure that contains configuration information for the attended transfer built in feature. More... | |
struct | ast_bridge_features_automixmonitor |
struct | ast_bridge_features_automonitor |
struct | ast_bridge_features_blind_transfer |
Structure that contains configuration information for the blind transfer built in feature. More... | |
struct | ast_bridge_features_limits |
Structure that contains configuration information for the limits feature. More... | |
struct | ast_bridge_hook |
Structure that is the essence of a feature hook. More... | |
struct | ast_bridge_hook_dtmf |
struct | ast_bridge_hook_dtmf_parms |
struct | ast_bridge_hook_timer |
struct | ast_bridge_hook_timer_parms |
Macros | |
#define | MAXIMUM_DTMF_FEATURE_STRING (11 + 1) |
Maximum length of a DTMF feature string. More... | |
Typedefs | |
typedef int(* | ast_bridge_builtin_set_limits_fn) (struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags) |
Attach interval hooks to a bridge features structure. More... | |
typedef int(* | ast_bridge_hook_callback) (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
Hook callback type. More... | |
typedef void(* | ast_bridge_hook_pvt_destructor) (void *hook_pvt) |
Hook pvt destructor callback. More... | |
typedef int(* | ast_bridge_move_indicate_callback) (struct ast_bridge_channel *bridge_channel, void *hook_pvt, struct ast_bridge *src, struct ast_bridge *dst) |
Move indicator callback. More... | |
typedef int(* | ast_bridge_talking_indicate_callback) (struct ast_bridge_channel *bridge_channel, void *hook_pvt, int talking) |
Talking indicator callback. More... | |
Functions | |
int | ast_bridge_dtmf_hook (struct ast_bridge_features *features, const char *dtmf, ast_bridge_hook_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Attach a DTMF hook to a bridge features structure. More... | |
void | ast_bridge_features_cleanup (struct ast_bridge_features *features) |
Clean up the contents of a bridge features structure. More... | |
void | ast_bridge_features_destroy (struct ast_bridge_features *features) |
Destroy an allocated bridge features struct. More... | |
int | ast_bridge_features_do (enum ast_bridge_builtin_feature feature, struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
Invoke a built in feature hook now. More... | |
int | ast_bridge_features_enable (struct ast_bridge_features *features, enum ast_bridge_builtin_feature feature, const char *dtmf, void *config, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Enable a built in feature on a bridge features structure. More... | |
int | ast_bridge_features_init (struct ast_bridge_features *features) |
Initialize bridge features structure. More... | |
int | ast_bridge_features_limits_construct (struct ast_bridge_features_limits *limits) |
Constructor function for ast_bridge_features_limits. More... | |
void | ast_bridge_features_limits_destroy (struct ast_bridge_features_limits *limits) |
Destructor function for ast_bridge_features_limits. More... | |
void | ast_bridge_features_merge (struct ast_bridge_features *into, const struct ast_bridge_features *from) |
Merge one ast_bridge_features into another. More... | |
struct ast_bridge_features * | ast_bridge_features_new (void) |
Allocate a new bridge features struct. More... | |
int | ast_bridge_features_register (enum ast_bridge_builtin_feature feature, ast_bridge_hook_callback callback, const char *dtmf) |
Register a handler for a built in feature. More... | |
void | ast_bridge_features_set_flag (struct ast_bridge_features *features, unsigned int flag) |
Set a flag on a bridge channel features structure. More... | |
int | ast_bridge_features_set_limits (struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags) |
Limit the amount of time a channel may stay in the bridge and optionally play warning messages as time runs out. More... | |
int | ast_bridge_features_unregister (enum ast_bridge_builtin_feature feature) |
Unregister a handler for a built in feature. More... | |
int | ast_bridge_hangup_hook (struct ast_bridge_features *features, ast_bridge_hook_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Attach a hangup hook to a bridge features structure. More... | |
int | ast_bridge_interval_hook (struct ast_bridge_features *features, enum ast_bridge_hook_timer_option flags, unsigned int interval, ast_bridge_hook_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Attach an interval hook to a bridge features structure. More... | |
int | ast_bridge_interval_register (enum ast_bridge_builtin_interval interval, ast_bridge_builtin_set_limits_fn callback) |
Register a handler for a built in interval feature. More... | |
int | ast_bridge_join_hook (struct ast_bridge_features *features, ast_bridge_hook_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Unregisters a handler for a built in interval feature. More... | |
int | ast_bridge_leave_hook (struct ast_bridge_features *features, ast_bridge_hook_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Attach a bridge channel leave hook to a bridge features structure. More... | |
int | ast_bridge_move_hook (struct ast_bridge_features *features, ast_bridge_move_indicate_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Attach a bridge channel move detection hook to a bridge features structure. More... | |
int | ast_bridge_talk_detector_hook (struct ast_bridge_features *features, ast_bridge_talking_indicate_callback callback, void *hook_pvt, ast_bridge_hook_pvt_destructor destructor, enum ast_bridge_hook_remove_flags remove_flags) |
Attach a bridge channel talk detection hook to a bridge features structure. More... | |
Channel Bridging API.
Definition in file bridge_features.h.
#define MAXIMUM_DTMF_FEATURE_STRING (11 + 1) |
Maximum length of a DTMF feature string.
Definition at line 217 of file bridge_features.h.
Referenced by action_playback_and_continue().
typedef int(* ast_bridge_builtin_set_limits_fn) (struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags) |
Attach interval hooks to a bridge features structure.
features | Bridge features structure |
limits | Configured limits applicable to the channel |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure |
Definition at line 422 of file bridge_features.h.
typedef int(* ast_bridge_hook_callback) (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
Hook callback type.
bridge_channel | Channel executing the feature |
hook_pvt | Private data passed in when the hook was created |
For interval hooks:
0 | Setup to fire again at the last interval. |
positive | Setup to fire again at the new interval returned. |
-1 | Remove the callback hook. |
For other hooks:
0 | Keep the callback hook. |
-1 | Remove the callback hook. |
Definition at line 136 of file bridge_features.h.
typedef void(* ast_bridge_hook_pvt_destructor) (void *hook_pvt) |
Hook pvt destructor callback.
hook_pvt | Private data passed in when the hook was created to destroy |
Definition at line 143 of file bridge_features.h.
typedef int(* ast_bridge_move_indicate_callback) (struct ast_bridge_channel *bridge_channel, void *hook_pvt, struct ast_bridge *src, struct ast_bridge *dst) |
Move indicator callback.
This callback can be registered with the bridge channel in order to be notified when the bridge channel is being moved from one bridge to another.
bridge_channel | The channel executing the feature |
hook_pvt | Private data passed in when the hook was created |
src | The bridge from which the bridge channel is moving |
dst | The bridge into which the bridge channel is moving |
0 | Keep the callback hook. |
-1 | Remove the callback hook. |
Definition at line 178 of file bridge_features.h.
typedef int(* ast_bridge_talking_indicate_callback) (struct ast_bridge_channel *bridge_channel, void *hook_pvt, int talking) |
Talking indicator callback.
This callback can be registered with the bridge channel in order to receive updates when the bridge_channel has started and stopped talking.
bridge_channel | Channel executing the feature |
hook_pvt | Private data passed in when the hook was created |
talking | TRUE if the channel is now talking |
0 | Keep the callback hook. |
-1 | Remove the callback hook. |
Definition at line 160 of file bridge_features.h.
Built in DTMF features.
Definition at line 71 of file bridge_features.h.
Enumerator | |
---|---|
AST_BRIDGE_BUILTIN_INTERVAL_LIMITS | Apply Call Duration Limits |
AST_BRIDGE_BUILTIN_INTERVAL_END | End terminator for list of built in interval features. Must remain last. |
Definition at line 110 of file bridge_features.h.
Flags used for per bridge channel features.
Definition at line 61 of file bridge_features.h.
Flags used for bridge features.
Definition at line 35 of file bridge_features.h.
Definition at line 310 of file bridge_features.h.
Definition at line 181 of file bridge_features.h.
Enumerator | |
---|---|
AST_BRIDGE_HOOK_TIMER_OPTION_MEDIA | The timer temporarily affects media. (Like a custom playfile.) |
Definition at line 233 of file bridge_features.h.
enum ast_bridge_hook_type |
Definition at line 188 of file bridge_features.h.
int ast_bridge_dtmf_hook | ( | struct ast_bridge_features * | features, |
const char * | dtmf, | ||
ast_bridge_hook_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Attach a DTMF hook to a bridge features structure.
features | Bridge features structure |
dtmf | DTMF string to be activated upon |
callback | Function to execute upon activation |
hook_pvt | Unique data |
destructor | Optional destructor callback for hook_pvt data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure (The caller must cleanup any hook_pvt resources.) |
Example usage:
This makes the bridging core call pound_callback if a channel that has this feature structure inputs the DTMF string '#'. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3245 of file bridge.c.
References ao2_link, ao2_ref, AST_BRIDGE_HOOK_TYPE_DTMF, ast_copy_string(), bridge_hook_generic(), ast_bridge_hook_dtmf_parms::code, ast_bridge_hook::destructor, ast_bridge_hook_dtmf::dtmf, ast_bridge_features::dtmf_hooks, ast_bridge_hook_dtmf::generic, NULL, and ast_bridge_hook::type.
Referenced by apply_menu_to_user(), ast_bridge_features_enable(), AST_TEST_DEFINE(), bridge_agent_hold_push(), bridge_personality_atxfer_push(), and dynamic_dtmf_hook_add().
void ast_bridge_features_cleanup | ( | struct ast_bridge_features * | features | ) |
Clean up the contents of a bridge features structure.
features | Bridge features structure |
Example usage:
This cleans up the feature structure 'features'.
Definition at line 3720 of file bridge.c.
References ao2_cleanup, ao2_ref, ast_heap_destroy(), ast_heap_pop(), ast_bridge_features::dtmf_hooks, ast_bridge_features::interval_hooks, NULL, and ast_bridge_features::other_hooks.
Referenced by agent_request_exec(), agent_run(), ast_bridge_call_with_flags(), ast_bridge_features_destroy(), AST_TEST_DEFINE(), bridge_exec(), bridgeadd_exec(), bridgewait_exec(), channel_feature_hooks_set_full(), confbridge_exec(), park_and_announce_app_exec(), park_app_exec(), and parked_call_app_exec().
void ast_bridge_features_destroy | ( | struct ast_bridge_features * | features | ) |
Destroy an allocated bridge features struct.
features | Bridge features structure |
Example usage:
Definition at line 3741 of file bridge.c.
References ast_bridge_features_cleanup(), and ast_free.
Referenced by ast_bridge_add_channel(), ast_bridge_call_with_flags(), ast_bridge_features_new(), ast_local_setup_bridge(), bridge_channel_depart_thread(), bridge_channel_ind_thread(), bridge_exec(), bridge_impart_internal(), conf_start_record(), control_dtor(), features_destroy(), and local_pvt_destructor().
int ast_bridge_features_do | ( | enum ast_bridge_builtin_feature | feature, |
struct ast_bridge_channel * | bridge_channel, | ||
void * | hook_pvt | ||
) |
Invoke a built in feature hook now.
feature | The feature to invoke |
bridge_channel | Channel executing the feature |
hook_pvt | Private data passed in when the hook was created |
0 | on success |
-1 | on failure |
Example usage:
Definition at line 3151 of file bridge.c.
References ARRAY_LEN, and builtin_features_handlers.
Referenced by agent_connect_caller().
int ast_bridge_features_enable | ( | struct ast_bridge_features * | features, |
enum ast_bridge_builtin_feature | feature, | ||
const char * | dtmf, | ||
void * | config, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Enable a built in feature on a bridge features structure.
features | Bridge features structure |
feature | Feature to enable |
dtmf | Optionally the DTMF stream to trigger the feature, if not specified it will be the default |
config | Configuration structure unique to the built in type |
destructor | Optional destructor callback for config data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure |
Example usage:
This enables the attended transfer DTMF option using the default DTMF string. An alternate string may be provided using the dtmf parameter. Internally this is simply setting up a hook to a built in feature callback function.
Definition at line 3428 of file bridge.c.
References ARRAY_LEN, ast_bridge_dtmf_hook(), ast_debug, ast_strlen_zero, builtin_features_dtmf, and builtin_features_handlers.
Referenced by builtin_features_helper().
int ast_bridge_features_init | ( | struct ast_bridge_features * | features | ) |
Initialize bridge features structure.
features | Bridge featues structure |
0 | on success |
-1 | on failure |
Example usage:
This initializes the feature structure 'features' to have nothing enabled.
Definition at line 3687 of file bridge.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, ast_heap_create, bridge_dtmf_hook_sort(), ast_bridge_features::dtmf_hooks, ast_bridge_features::dtmf_passthrough, interval_hook_time_cmp(), ast_bridge_features::interval_hooks, NULL, ast_bridge_features::other_hooks, ast_bridge_features::text_messaging, and timer.
Referenced by agent_request_exec(), agent_run(), ast_bridge_call_with_flags(), ast_bridge_features_new(), AST_TEST_DEFINE(), bridge_exec(), bridgeadd_exec(), bridgewait_exec(), channel_feature_hooks_set_full(), confbridge_exec(), park_and_announce_app_exec(), park_app_exec(), and parked_call_app_exec().
int ast_bridge_features_limits_construct | ( | struct ast_bridge_features_limits * | limits | ) |
Constructor function for ast_bridge_features_limits.
limits | pointer to a ast_bridge_features_limits struct that has been allocted, but not initialized |
0 | on success |
-1 | on failure |
Definition at line 3459 of file bridge.c.
References ast_string_field_init.
Referenced by bridge_builtin_set_limits(), and pre_bridge_setup().
void ast_bridge_features_limits_destroy | ( | struct ast_bridge_features_limits * | limits | ) |
Destructor function for ast_bridge_features_limits.
limits | pointer to an ast_bridge_features_limits struct that needs to be destroyed |
This function does not free memory allocated to the ast_bridge_features_limits struct, it only frees elements within the struct. You must still call ast_free on the struct if you allocated it with malloc.
Definition at line 3470 of file bridge.c.
References ast_string_field_free_memory.
Referenced by bridge_features_limits_dtor(), and pre_bridge_setup().
void ast_bridge_features_merge | ( | struct ast_bridge_features * | into, |
const struct ast_bridge_features * | from | ||
) |
Merge one ast_bridge_features into another.
into | The ast_bridge_features that will be merged into |
from | The ast_bridge_features that will be merged from |
Definition at line 3662 of file bridge.c.
References ao2_callback, ast_heap_peek(), ast_heap_unlock, ast_heap_wrlock, ast_bridge_features::dtmf_hooks, ast_bridge_features::dtmf_passthrough, ast_bridge_features::feature_flags, ast_flags::flags, ast_bridge_features::interval_hooks, merge_container_cb(), ast_bridge_features::mute, ast_bridge_features::other_hooks, ast_bridge_features::usable, and wrap_hook().
Referenced by bridge_channel_internal_join(), and channel_feature_hooks_set_full().
struct ast_bridge_features* ast_bridge_features_new | ( | void | ) |
Allocate a new bridge features struct.
Example usage:
features | New allocated features struct. |
NULL | on error. |
Definition at line 3750 of file bridge.c.
References ast_bridge_features_destroy(), ast_bridge_features_init(), ast_malloc, and NULL.
Referenced by ast_bridge_call_with_flags(), ast_unreal_channel_push_to_bridge(), bridge_exec(), bridge_impart_internal(), channel_feature_hooks_set_full(), conf_announce_channel_push(), conf_start_record(), and stasis_app_control_bridge_features_init().
int ast_bridge_features_register | ( | enum ast_bridge_builtin_feature | feature, |
ast_bridge_hook_callback | callback, | ||
const char * | dtmf | ||
) |
Register a handler for a built in feature.
feature | The feature that the handler will be responsible for |
callback | The callback function that will handle it |
dtmf | Default DTMF string used to activate the feature |
0 | on success |
-1 | on failure |
Example usage:
This registers the function bridge_builtin_attended_transfer as the function responsible for the built in attended transfer feature.
Definition at line 3123 of file bridge.c.
References ARRAY_LEN, ast_copy_string(), ast_strlen_zero, builtin_features_dtmf, and builtin_features_handlers.
Referenced by ast_bridging_init_basic(), load_module(), and load_parking_bridge_features().
void ast_bridge_features_set_flag | ( | struct ast_bridge_features * | features, |
unsigned int | flag | ||
) |
Set a flag on a bridge channel features structure.
features | Bridge channel features structure |
flag | Flag to enable |
Example usage:
This sets the AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP feature to be enabled on the features structure 'features'.
Definition at line 3490 of file bridge.c.
References ast_set_flag, ast_bridge_features::feature_flags, and ast_bridge_features::usable.
int ast_bridge_features_set_limits | ( | struct ast_bridge_features * | features, |
struct ast_bridge_features_limits * | limits, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Limit the amount of time a channel may stay in the bridge and optionally play warning messages as time runs out.
features | Bridge features structure |
limits | Configured limits applicable to the channel |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure |
Example usage:
This sets the maximum time the channel can be in the bridge to 10 seconds and does not play any warnings.
Definition at line 3475 of file bridge.c.
References AST_BRIDGE_BUILTIN_INTERVAL_LIMITS, ast_log, builtin_interval_handlers, and LOG_ERROR.
Referenced by pre_bridge_setup().
int ast_bridge_features_unregister | ( | enum ast_bridge_builtin_feature | feature | ) |
Unregister a handler for a built in feature.
feature | The feature to unregister |
0 | on success |
-1 | on failure |
Example usage:
This unregisters the function that is handling the built in attended transfer feature.
Definition at line 3139 of file bridge.c.
References ARRAY_LEN, builtin_features_handlers, and NULL.
Referenced by unload_module(), and unload_parking_bridge_features().
int ast_bridge_hangup_hook | ( | struct ast_bridge_features * | features, |
ast_bridge_hook_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Attach a hangup hook to a bridge features structure.
features | Bridge features structure |
callback | Function to execute upon activation |
hook_pvt | Unique data |
destructor | Optional destructor callback for hook_pvt data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure (The caller must cleanup any hook_pvt resources.) |
Example usage:
This makes the bridging core call hangup_callback if a channel that has this hook hangs up. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3328 of file bridge.c.
References AST_BRIDGE_HOOK_TYPE_HANGUP, and bridge_other_hook().
Referenced by add_normal_hooks(), and bridge_personality_atxfer_push().
int ast_bridge_interval_hook | ( | struct ast_bridge_features * | features, |
enum ast_bridge_hook_timer_option | flags, | ||
unsigned int | interval, | ||
ast_bridge_hook_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Attach an interval hook to a bridge features structure.
features | Bridge features structure |
flags | Interval timer callback option flags. |
interval | The interval that the hook should execute at in milliseconds |
callback | Function to execute upon activation |
hook_pvt | Unique data |
destructor | Optional destructor callback for hook_pvt data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure (The caller must cleanup any hook_pvt resources.) |
This makes the bridging core call playback_callback every second. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3382 of file bridge.c.
References ao2_ref, ast_atomic_fetchadd_int(), AST_BRIDGE_HOOK_TYPE_TIMER, ast_debug, ast_heap_push, ast_heap_unlock, ast_heap_wrlock, ast_samp2tv(), ast_tvadd(), ast_tvnow(), bridge_hook_generic(), ast_bridge_hook::destructor, ast_bridge_hook_timer_parms::flags, ast_bridge_hook_timer::generic, ast_bridge_hook_timer_parms::interval, ast_bridge_features::interval_hooks, ast_bridge_features::interval_sequence, NULL, ast_bridge_hook_timer_parms::seqno, ast_bridge_hook_timer::timer, ast_bridge_hook_timer_parms::trip_time, and ast_bridge_hook::type.
Referenced by agent_request_exec(), apply_option_timeout(), AST_TEST_DEFINE(), bridge_agent_hold_push(), bridge_builtin_set_limits(), confbridge_exec(), parking_set_duration(), set_interval_hook(), and wrap_hook().
int ast_bridge_interval_register | ( | enum ast_bridge_builtin_interval | interval, |
ast_bridge_builtin_set_limits_fn | callback | ||
) |
Register a handler for a built in interval feature.
interval | The interval feature that the handler will be responsible for |
callback | the Callback function that will handle it |
0 | on success |
-1 | on failure |
Example usage:
This registers the function bridge_builtin_set_limits as the function responsible for the built in duration limit feature.
Definition at line 3168 of file bridge.c.
References ARRAY_LEN, and builtin_interval_handlers.
Referenced by load_module().
int ast_bridge_join_hook | ( | struct ast_bridge_features * | features, |
ast_bridge_hook_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Unregisters a handler for a built in interval feature.
interval | the interval feature to unregister |
0 | on success |
-1 | on failure |
Example usage:
This makes the bridging core call join_callback when a channel successfully joins the bridging system. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3338 of file bridge.c.
References AST_BRIDGE_HOOK_TYPE_JOIN, and bridge_other_hook().
Referenced by agent_request_exec(), and confbridge_exec().
int ast_bridge_leave_hook | ( | struct ast_bridge_features * | features, |
ast_bridge_hook_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Attach a bridge channel leave hook to a bridge features structure.
features | Bridge features structure |
callback | Function to execute upon activation |
hook_pvt | Unique data |
destructor | Optional destructor callback for hook_pvt data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure (The caller must cleanup any hook_pvt resources.) |
Example usage:
This makes the bridging core call leave_callback when a channel successfully leaves the bridging system. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3348 of file bridge.c.
References AST_BRIDGE_HOOK_TYPE_LEAVE, and bridge_other_hook().
Referenced by confbridge_exec().
int ast_bridge_move_hook | ( | struct ast_bridge_features * | features, |
ast_bridge_move_indicate_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Attach a bridge channel move detection hook to a bridge features structure.
features | Bridge features structure |
callback | Function to execute upon activation |
hook_pvt | Unique data |
destructor | Optional destructor callback for hook_pvt data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure (The caller must cleanup any hook_pvt resources.) |
Example usage:
This makes the bridging core call callback when a channel is moved from one bridge to another. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3370 of file bridge.c.
References AST_BRIDGE_HOOK_TYPE_MOVE, bridge_other_hook(), and hook_cb().
Referenced by bridge_stasis_pull().
int ast_bridge_talk_detector_hook | ( | struct ast_bridge_features * | features, |
ast_bridge_talking_indicate_callback | callback, | ||
void * | hook_pvt, | ||
ast_bridge_hook_pvt_destructor | destructor, | ||
enum ast_bridge_hook_remove_flags | remove_flags | ||
) |
Attach a bridge channel talk detection hook to a bridge features structure.
features | Bridge features structure |
callback | Function to execute upon activation |
hook_pvt | Unique data |
destructor | Optional destructor callback for hook_pvt data |
remove_flags | Dictates what situations the hook should be removed. |
0 | on success |
-1 | on failure (The caller must cleanup any hook_pvt resources.) |
Example usage:
This makes the bridging technology call talk_callback when a channel is recognized as starting and stopping talking. A pointer to useful data may be provided to the hook_pvt parameter.
Definition at line 3358 of file bridge.c.
References AST_BRIDGE_HOOK_TYPE_TALK, bridge_other_hook(), and hook_cb().
Referenced by confbridge_exec().