116 #define APP_NAME "BridgeWait" 117 #define DEFAULT_BRIDGE_NAME "default" 163 const char *right_key = obj_right;
168 right_key = right->
name;
171 cmp = strcmp(left->
name, right_key);
174 cmp = strncmp(left->
name, right_key, strlen(right_key));
214 unsigned int duration;
220 if (sscanf(duration_arg,
"%u", &duration) != 1 || duration == 0) {
243 char entertainment = entertainment_arg[0];
245 switch (entertainment) {
257 ast_log(
LOG_ERROR,
"Invalid argument for BridgeWait entertainment '%s'\n", entertainment_arg);
323 bridge_wrapper =
ao2_alloc_options(
sizeof(*bridge_wrapper) + strlen(bridge_name) + 1,
325 if (!bridge_wrapper) {
330 strcpy(bridge_wrapper->
name, bridge_name);
333 if (!
ao2_link(wait_bridge_wrappers, bridge_wrapper)) {
338 return bridge_wrapper;
385 if (
ao2_ref(wrapper, 0) == 2) {
407 if (!strcmp(role,
"participant")) {
409 }
else if (!strcmp(role,
"announcer")) {
438 bridge_name =
args.name;
451 ast_log(
LOG_ERROR,
"'%s' failed to enter the waiting bridge - could not set up channel features\n",
471 if (!bridge_wrapper) {
505 if (!wait_bridge_wrappers) {
static int apply_option_entertainment(struct ast_channel *chan, const char *entertainment_arg)
Main Channel structure associated with a channel.
void ast_bridge_features_cleanup(struct ast_bridge_features *features)
Clean up the contents of a bridge features structure.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
const ast_string_field uniqueid
Structure that contains features information.
#define ast_test_flag(p, flag)
static const struct ast_app_option bridgewait_opts[128]
static int apply_option_timeout(struct ast_bridge_features *features, char *duration_arg)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_check_hangup_locked(struct ast_channel *chan)
int ast_bridge_features_init(struct ast_bridge_features *features)
Initialize bridge features structure.
static int wait_bridge_sort_fn(const void *obj_left, const void *obj_right, const int flags)
ast_channel_state
ast_channel states
int ast_bridge_destroy(struct ast_bridge *bridge, int cause)
Destroy a bridge.
static struct wait_bridge_wrapper * wait_bridge_wrapper_find_by_name(const char *bridge_name)
#define ao2_alloc_options(data_size, destructor_fn, options)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_channel_add_bridge_role(struct ast_channel *chan, const char *role_name)
Adds a bridge role to a channel.
int ast_unregister_application(const char *app)
Unregister an application.
static int unload_module(void)
#define ast_verb(level,...)
static struct wait_bridge_wrapper * get_wait_bridge_wrapper(const char *bridge_name)
#define ast_strlen_zero(foo)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
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.
static struct wait_bridge_wrapper * wait_bridge_wrapper_alloc(const char *bridge_name, struct ast_bridge *bridge)
General Asterisk PBX channel definitions.
static void wait_wrapper_removal(struct wait_bridge_wrapper *wrapper)
#define AST_CAUSE_NORMAL_CLEARING
#define ao2_ref(o, delta)
#define ast_strdupa(s)
duplicate a string in memory from the stack
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.
static int wait_bridge_hash_fn(const void *obj, const int flags)
static int bridgewait_timeout_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
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_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.
Core PBX routines and definitions.
Structure that contains information about a bridge.
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
#define ao2_unlink(container, obj)
static int bridgewait_exec(struct ast_channel *chan, const char *data)
#define DEFAULT_BRIDGE_NAME
static int load_module(void)
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).
struct ast_bridge * bridge
static void wait_bridge_wrapper_destructor(void *obj)
static enum wait_bridge_roles validate_role(const char *role)
static void parse(struct mgcp_request *req)
#define SCOPED_AO2LOCK(varname, obj)
scoped lock specialization for ao2 mutexes.
#define ao2_find(container, arg, flags)
Structure used to handle boolean flags.
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)
static int process_options(struct ast_channel *chan, struct ast_flags *flags, char **opts, struct ast_bridge_features *features, enum wait_bridge_roles role)
struct ast_channel * chan
Structure that contains information regarding a channel in a bridge.
static int apply_option_moh(struct ast_channel *chan, const char *class_arg)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
Internal Asterisk hangup causes.
Reject objects with duplicate keys in container.
Call Parking and Pickup API Includes code and algorithms from the Zapata library. ...
Say numbers and dates (maybe words one day too)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static struct ao2_container * wait_bridge_wrappers
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define ao2_link(container, obj)