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;
149 if (!chan_tech_pvt) {
166 ast_debug(2,
"Stop native bridging %s and %s\n",
352 ast_debug(3,
"master: %d, slave: %d, nothing_ok: %d\n",
368 "Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",
371 tone_zone_play_tone(p0->
subs[npc0->
index].
dfd, DAHDI_TONE_RINGTONE);
374 ast_debug(2,
"Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
386 "Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",
389 tone_zone_play_tone(p1->
subs[npc1->
index].
dfd, DAHDI_TONE_RINGTONE);
392 ast_debug(2,
"Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
407 }
else if (!nothing_ok) {
419 if ((!
master || !slave) && !nothing_ok) {
437 tech_pvt->
slave = slave;
439 ast_debug(2,
"Start native bridging %s and %s\n",
442#if defined(HAVE_PRI) && defined(PRI_2BCT)
443 if (!tech_pvt->tried_trombone_removal) {
444 tech_pvt->tried_trombone_removal = 1;
446 if (p0->pri && p0->pri == p1->pri && p0->pri->
transfer) {
456 if (q931_c0 && q931_c1) {
457 pri_channel_bridge(q931_c0, q931_c1);
458 ast_debug(2,
"Attempt to eliminate tromboned call with %s and %s\n",
599 tech_pvt = bridge_channel->
tech_pvt;
651 ast_debug(2,
"Channel '%s' is not %s.\n",
657 ast_debug(2,
"Channel '%s' has an active monitor, audiohook, or framehook.\n",
663 if (!pvt || !pvt->
sig) {
677 ast_debug(2,
"Channel '%s' has call waiting caller ID enabled.\n",
705 ast_debug(1,
"Bridge %s: Cannot use native DAHDI. Must have two channels.\n",
712 ast_debug(1,
"Bridge %s: Cannot use native DAHDI. Channel '%s' not compatible.\n",
742 tech_pvt = bridge_channel->
tech_pvt;
744 chan = bridge_channel->
chan;
747 if (tech_pvt->
pvt == pvt) {
759 || tech_pvt->
index != idx
767 && tech_pvt->
state > -1
793 ast_debug(1,
"Bridge %s: Something changed on channel '%s'.\n",
863 .
name =
"native_dahdi",
Asterisk main include file. File version handling, generic pbx functions.
#define ast_calloc(num, len)
A wrapper for calloc()
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
@ AST_BRIDGE_CAPABILITY_NATIVE
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_stop(struct ast_bridge *bridge)
static const struct ast_channel_tech * dahdi_tech
static int native_chan_changed(struct ast_bridge_channel *bridge_channel)
static int native_start(struct ast_bridge *bridge)
void dahdi_native_unload(void)
static int native_bridge_changed(struct ast_bridge *bridge)
static void native_bridge_destroy(struct ast_bridge *bridge)
static void native_bridge_unsuspend(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static void native_bridge_stop(struct ast_bridge *bridge)
static int native_bridge_is_capable(struct ast_bridge_channel *bridge_channel)
static void native_request_stop(struct ast_bridge *bridge)
static int native_bridge_compatible(struct ast_bridge *bridge)
static int native_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static void native_bridge_suspend(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
static int native_bridge_create(struct ast_bridge *bridge)
static int native_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
static void native_request_start(struct ast_bridge *bridge)
static struct ast_bridge_technology native_bridge
static int native_bridge_start(struct ast_bridge *bridge)
static void native_bridge_leave(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
int dahdi_native_load(const struct ast_channel_tech *tech)
Native DAHDI bridging support.
@ AST_BRIDGE_PREFERENCE_BASE_NATIVE
#define ast_bridge_technology_register(technology)
See __ast_bridge_technology_register()
int ast_bridge_technology_unregister(struct ast_bridge_technology *technology)
Unregister a bridge technology from use.
void dahdi_ec_enable(struct dahdi_pvt *p)
void dahdi_conf_update(struct dahdi_pvt *p)
void dahdi_dtmf_detect_enable(struct dahdi_pvt *p)
void dahdi_ec_disable(struct dahdi_pvt *p)
void dahdi_master_slave_unlink(struct dahdi_pvt *slave, struct dahdi_pvt *master, int needlock)
void dahdi_dtmf_detect_disable(struct dahdi_pvt *p)
void dahdi_master_slave_link(struct dahdi_pvt *slave, struct dahdi_pvt *master)
const char *const subnames[]
static int dahdi_sig_pri_lib_handles(int signaling)
#define dahdi_get_index(ast, p, nullok)
static int call(void *data)
const char * ast_channel_name(const struct ast_channel *chan)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define ast_channel_lock(chan)
int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
Make the frame formats of two channels compatible.
#define ast_channel_trylock(chan)
int ast_channel_fd(const struct ast_channel *chan, int which)
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
int ast_channel_has_audio_frame_or_monitor(struct ast_channel *chan)
Check if the channel has active audiohooks, active framehooks, or a monitor.
ast_channel_state
ast_channel states
Asterisk internal frame definitions.
#define ast_debug(level,...)
Log a DEBUG message.
#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_LIST_FIRST(head)
Returns the first entry contained in a list.
#define ast_mutex_unlock(a)
#define ast_mutex_trylock(a)
#define ast_mutex_lock(a)
Structure that contains information regarding a channel in a bridge.
void * tech_pvt
Private information unique to the bridge technology.
struct ast_bridge * bridge
Bridge this channel is participating in.
struct ast_bridge_features * features
struct ast_channel * chan
struct ao2_container * dtmf_hooks
Structure that is the essence of a bridge technology.
Structure that contains information about a bridge.
const ast_string_field uniqueid
struct ast_bridge_channels_list channels
unsigned int num_channels
Structure to describe a channel "technology", ie a channel driver See for examples:
Main Channel structure associated with a channel.
struct ast_bridge_channel * bridge_channel
struct ast_bridge * bridge
Data structure associated with a single frame of data.
enum ast_frame_type frametype
struct dahdi_pvt * master
unsigned int callwaitingcallerid
TRUE if send caller ID for Call Waiting.
struct dahdi_subchannel subs[3]
unsigned int callwaiting
TRUE if busy extensions will hear the call-waiting tone and can use hook-flash to switch between call...
struct ast_channel * owner
unsigned int echocanbridged
TRUE if echo cancellation enabled when bridged.
unsigned int transfer
TRUE if call transfer is enabled.
struct ast_channel * owner
struct dahdi_pvt * master
struct ast_channel * owner