40 #include <sys/types.h> 125 }
else if (!strcmp(idle_mode,
"musiconhold")) {
127 }
else if (!strcmp(idle_mode,
"ringing")) {
129 }
else if (!strcmp(idle_mode,
"none")) {
131 }
else if (!strcmp(idle_mode,
"silence")) {
133 }
else if (!strcmp(idle_mode,
"hold")) {
137 ast_debug(1,
"channel %s idle mode '%s' doesn't match any defined idle mode\n",
180 chan = bridge_channel->
chan;
191 const char *moh_class;
222 moh_length = moh_class ? strlen(moh_class + 1) : 0;
233 if (!announcer_channel) {
260 announcer_channel = bridge->
tech_pvt;
263 if (announcer_channel) {
267 ast_log(
LOG_WARNING,
"Bridge %s: Channel %s tried to be an announcer. Bridge already has one.\n",
283 if (bridge_channel == other_channel) {
382 if (announcer_channel) {
395 .
name =
"holding_bridge",
static int holding_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
int ast_bridge_channel_has_role(struct ast_bridge_channel *bridge_channel, const char *role_name)
Check to see if a bridge channel inherited a specific role from its channel.
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
const ast_string_field uniqueid
struct ast_silence_generator * silence_generator
static void holding_bridge_leave(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static void participant_entertainment_start(struct ast_bridge_channel *bridge_channel)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
static void holding_bridge_suspend(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static void handle_participant_join(struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *announcer_channel)
enum idle_modes idle_mode
int ast_indicate_data(struct ast_channel *chan, int condition, const void *data, size_t datalen)
Indicates condition of channel, with payload.
static int holding_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static int unload_module(void)
int ast_bridge_queue_everyone_else(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
Queue the given frame to everyone else.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
struct ast_bridge * bridge
Bridge this channel is participating in.
#define ast_strlen_zero(foo)
struct ast_bridge_technology * technology
static int defer_action(struct ast_bridge_channel *bridge_channel, deferred_cb callback)
#define ast_debug(level,...)
Log a DEBUG message.
General Asterisk PBX channel definitions.
static int load_module(void)
Structure which contains per-channel role information.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
Asterisk internal frame definitions.
void(* deferred_cb)(struct ast_bridge_channel *bridge_channel)
static void participant_reaction_announcer_join(struct ast_bridge_channel *bridge_channel)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
#define ast_bridge_technology_register(technology)
See __ast_bridge_technology_register()
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
static void participant_entertainment_stop(struct ast_bridge_channel *bridge_channel)
Structure that contains information about a bridge.
int ast_bridge_technology_unregister(struct ast_bridge_technology *technology)
Unregister a bridge technology from use.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
static struct ast_bridge_technology holding_bridge
int ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_custom_callback_option flags, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
Queue a bridge action custom callback frame onto the bridge channel.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
void ast_channel_stop_silence_generator(struct ast_channel *chan, struct ast_silence_generator *state)
Stops a previously-started silence generator on the given channel.
#define ast_bridge_unlock(bridge)
Unlock the bridge.
#define ast_calloc(num, len)
A wrapper for calloc()
Module has failed to load, may be in an inconsistent state.
void * tech_pvt
Private information unique to the bridge technology.
struct ast_bridge_channels_list channels
struct ast_channel * chan
Structure that contains information regarding a channel in a bridge.
void ast_bridge_channel_lock_bridge(struct ast_bridge_channel *bridge_channel)
Lock the bridge associated with the bridge channel.
static void holding_bridge_unsuspend(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
const char * ast_channel_name(const struct ast_channel *chan)
Structure that is the essence of a bridge technology.
Data structure associated with a single frame of data.
static void participant_reaction_announcer_leave(struct ast_bridge_channel *bridge_channel)
void ast_bridge_channel_restore_formats(struct ast_bridge_channel *bridge_channel)
Restore the formats of a bridge channel's channel to how they were before bridge_channel_internal_joi...
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
const char * ast_bridge_channel_get_role_option(struct ast_bridge_channel *bridge_channel, const char *role_name, const char *option)
Retrieve the value of a requested role option from a bridge channel.
static void participant_idle_mode_setup(struct ast_bridge_channel *bridge_channel)
unsigned int entertainment_active
static void deferred_action(struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size)