35 #include "../sig_analog.h" 37 #include "../sig_pri.h" 39 #include "../chan_dahdi.h" 75 #if defined(HAVE_PRI) && defined(PRI_2BCT) 83 unsigned int tried_trombone_removal:1;
151 if (!chan_tech_pvt) {
168 ast_debug(2,
"Stop native bridging %s and %s\n",
278 #
if defined(HAVE_PRI)
356 ast_debug(3,
"master: %d, slave: %d, nothing_ok: %d\n",
360 if (master && slave) {
372 "Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",
375 tone_zone_play_tone(p0->
subs[npc0->
index].
dfd, DAHDI_TONE_RINGTONE);
378 ast_debug(2,
"Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
390 "Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",
393 tone_zone_play_tone(p1->
subs[npc1->
index].
dfd, DAHDI_TONE_RINGTONE);
396 ast_debug(2,
"Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
411 }
else if (!nothing_ok) {
423 if ((!master || !slave) && !nothing_ok) {
441 tech_pvt->
slave = slave;
443 ast_debug(2,
"Start native bridging %s and %s\n",
446 #if defined(HAVE_PRI) && defined(PRI_2BCT) 447 if (!tech_pvt->tried_trombone_removal) {
448 tech_pvt->tried_trombone_removal = 1;
450 if (p0->pri && p0->pri == p1->pri && p0->pri->
transfer) {
460 if (q931_c0 && q931_c1) {
461 pri_channel_bridge(q931_c0, q931_c1);
462 ast_debug(2,
"Attempt to eliminate tromboned call with %s and %s\n",
605 tech_pvt = bridge_channel->
tech_pvt;
657 ast_debug(2,
"Channel '%s' is not %s.\n",
663 ast_debug(2,
"Channel '%s' has an active monitor, audiohook, or framehook.\n",
669 if (!pvt || !pvt->
sig) {
683 ast_debug(2,
"Channel '%s' has call waiting caller ID enabled.\n",
711 ast_debug(1,
"Bridge %s: Cannot use native DAHDI. Must have two channels.\n",
718 ast_debug(1,
"Bridge %s: Cannot use native DAHDI. Channel '%s' not compatible.\n",
748 tech_pvt = bridge_channel->
tech_pvt;
750 chan = bridge_channel->
chan;
753 if (tech_pvt->
pvt == pvt) {
765 || tech_pvt->
index != idx
773 && tech_pvt->
state > -1
799 ast_debug(1,
"Bridge %s: Something changed on channel '%s'.\n",
869 .
name =
"native_dahdi",
#define dahdi_get_index(ast, p, nullok)
static void native_bridge_leave(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
void dahdi_dtmf_detect_disable(struct dahdi_pvt *p)
static int native_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
Asterisk main include file. File version handling, generic pbx functions.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
static int dahdi_sig_pri_lib_handles(int signaling)
const ast_string_field uniqueid
unsigned int callwaiting
TRUE if busy extensions will hear the call-waiting tone and can use hook-flash to switch between call...
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
struct ast_bridge_features * features
struct dahdi_subchannel subs[3]
void dahdi_master_slave_unlink(struct dahdi_pvt *slave, struct dahdi_pvt *master, int needlock)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
unsigned int callwaitingcallerid
TRUE if send caller ID for Call Waiting.
void dahdi_ec_enable(struct dahdi_pvt *p)
struct dahdi_pvt * master
Native DAHDI bridging support.
struct ast_channel * owner
static int native_start(struct ast_bridge *bridge)
ast_channel_state
ast_channel states
struct ao2_container * dtmf_hooks
static void native_stop(struct ast_bridge *bridge)
void dahdi_ec_disable(struct dahdi_pvt *p)
#define ast_mutex_lock(a)
static int call(void *data)
void dahdi_conf_update(struct dahdi_pvt *p)
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.
static void native_request_start(struct ast_bridge *bridge)
static int native_chan_changed(struct ast_bridge_channel *bridge_channel)
const char *const subnames[]
struct ast_bridge * bridge
Bridge this channel is participating in.
static int native_bridge_changed(struct ast_bridge *bridge)
int dahdi_native_load(const struct ast_channel_tech *tech)
static const struct ast_channel_tech * dahdi_tech
static int native_bridge_is_capable(struct ast_bridge_channel *bridge_channel)
#define ast_debug(level,...)
Log a DEBUG message.
unsigned int transfer
TRUE if call transfer is enabled.
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
static void native_bridge_unsuspend(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
#define ast_mutex_trylock(a)
static void native_request_stop(struct ast_bridge *bridge)
Asterisk internal frame definitions.
struct ast_channel * owner
static int native_bridge_start(struct ast_bridge *bridge)
Structure to describe a channel "technology", ie a channel driver See for examples: ...
#define ast_bridge_technology_register(technology)
See __ast_bridge_technology_register()
static int native_bridge_compatible(struct ast_bridge *bridge)
Structure that contains information about a bridge.
int ast_bridge_technology_unregister(struct ast_bridge_technology *technology)
Unregister a bridge technology from use.
static void native_bridge_destroy(struct ast_bridge *bridge)
static void native_bridge_suspend(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define ast_channel_unlock(chan)
struct dahdi_pvt * master
#define ast_calloc(num, len)
A wrapper for calloc()
void dahdi_master_slave_link(struct dahdi_pvt *slave, struct dahdi_pvt *master)
void dahdi_dtmf_detect_enable(struct dahdi_pvt *p)
static int native_bridge_create(struct ast_bridge *bridge)
void * tech_pvt
Private information unique to the bridge technology.
void dahdi_native_unload(void)
int ast_channel_fd(const struct ast_channel *chan, int which)
struct ast_bridge_channels_list channels
struct ast_channel * chan
Structure that contains information regarding a channel in a bridge.
const char * ast_channel_name(const struct ast_channel *chan)
Structure that is the essence of a bridge technology.
static struct ast_bridge_technology native_bridge
Data structure associated with a single frame of data.
unsigned int echocanbridged
TRUE if echo cancellation enabled when bridged.
enum ast_frame_type frametype
#define ast_channel_trylock(chan)
static void native_bridge_stop(struct ast_bridge *bridge)
struct ast_channel * owner
int ast_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
Check if the channel has active audiohooks, active framehooks, or a monitor.
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
static int native_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
unsigned int num_channels
#define ast_mutex_unlock(a)