119#define APP_NAME "BridgeWait"
120#define DEFAULT_BRIDGE_NAME "default"
166 const char *right_key = obj_right;
171 right_key = right->
name;
174 cmp = strcmp(left->
name, right_key);
177 cmp = strncmp(left->
name, right_key, strlen(right_key));
219 unsigned int duration;
225 if (sscanf(duration_arg,
"%u", &duration) != 1 || duration == 0) {
248 char entertainment = entertainment_arg[0];
250 switch (entertainment) {
262 ast_log(
LOG_ERROR,
"Invalid argument for BridgeWait entertainment '%s'\n", entertainment_arg);
328 bridge_wrapper =
ao2_alloc_options(
sizeof(*bridge_wrapper) + strlen(bridge_name) + 1,
330 if (!bridge_wrapper) {
335 strcpy(bridge_wrapper->
name, bridge_name);
343 return bridge_wrapper;
390 if (
ao2_ref(wrapper, 0) == 2) {
401 if (!strcmp(role,
"participant")) {
403 }
else if (!strcmp(role,
"announcer")) {
443 bridge_name =
args.name;
456 ast_log(
LOG_ERROR,
"'%s' failed to enter the waiting bridge - could not set up channel features\n",
476 if (!bridge_wrapper) {
static enum wait_bridge_roles validate_role(const char *role)
static int apply_option_timeout(struct ast_bridge_features *features, char *duration_arg)
static int apply_option_moh(struct ast_channel *chan, const char *class_arg)
static int wait_bridge_hash_fn(const void *obj, const int flags)
static int apply_option_entertainment(struct ast_channel *chan, const char *entertainment_arg)
static int bridgewait_exec(struct ast_channel *chan, const char *data)
#define DEFAULT_BRIDGE_NAME
static int process_options(struct ast_channel *chan, struct ast_flags *flags, char **opts, struct ast_bridge_features *features, enum wait_bridge_roles role)
static const struct ast_app_option bridgewait_opts[128]
static struct wait_bridge_wrapper * wait_bridge_wrapper_find_by_name(const char *bridge_name)
static void wait_bridge_wrapper_destructor(void *obj)
static int bridgewait_timeout_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static struct wait_bridge_wrapper * get_wait_bridge_wrapper(const char *bridge_name)
static struct ao2_container * wait_bridge_wrappers
static int load_module(void)
static int unload_module(void)
static int wait_bridge_sort_fn(const void *obj_left, const void *obj_right, const int flags)
static struct wait_bridge_wrapper * wait_bridge_wrapper_alloc(const char *bridge_name, struct ast_bridge *bridge)
static void wait_wrapper_removal(struct wait_bridge_wrapper *wrapper)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_find(container, arg, flags)
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
@ AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT
Reject objects with duplicate keys in container.
struct ast_bridge * ast_bridge_base_new(uint32_t capabilities, unsigned int flags, const char *creator, const char *name, const char *id)
Create a new base class bridge.
int ast_bridge_join(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, struct ast_bridge_tech_optimizations *tech_args, enum ast_bridge_join_flags flags)
Join a channel to a bridge (blocking)
int ast_bridge_destroy(struct ast_bridge *bridge, int cause)
Destroy a bridge.
@ AST_BRIDGE_CAPABILITY_HOLDING
@ BRIDGE_CHANNEL_STATE_END
void ast_bridge_channel_leave_bridge(struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause)
Set bridge channel state to leave bridge (if not leaving already).
int ast_bridge_features_init(struct ast_bridge_features *features)
Initialize bridge features structure.
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.
@ AST_BRIDGE_HOOK_REMOVE_ON_PULL
@ AST_BRIDGE_FLAG_SWAP_INHIBIT_TO
@ AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM
@ AST_BRIDGE_FLAG_TRANSFER_PROHIBITED
@ AST_BRIDGE_FLAG_MERGE_INHIBIT_TO
@ AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
void ast_bridge_features_cleanup(struct ast_bridge_features *features)
Clean up the contents of a bridge features structure.
int ast_channel_set_bridge_role_option(struct ast_channel *channel, const char *role_name, const char *option, const char *value)
Set a role option on a channel.
int ast_channel_add_bridge_role(struct ast_channel *chan, const char *role_name)
Adds a bridge role to a channel.
Internal Asterisk hangup causes.
#define AST_CAUSE_NORMAL_CLEARING
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
int ast_check_hangup_locked(struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
ast_channel_state
ast_channel states
Call Parking and Pickup API Includes code and algorithms from the Zapata library.
Generic File Format Support. Should be included by clients of the file handling routines....
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
#define ast_verb(level,...)
Asterisk locking-related definitions:
#define SCOPED_AO2LOCK(varname, obj)
scoped lock specialization for ao2 mutexes.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Core PBX routines and definitions.
Say numbers and dates (maybe words one day too)
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Structure that contains information regarding a channel in a bridge.
struct ast_channel * chan
Structure that contains features information.
Structure that contains information about a bridge.
const ast_string_field uniqueid
Main Channel structure associated with a channel.
Structure used to handle boolean flags.
struct ast_bridge * bridge
#define ast_test_flag(p, flag)