29#ifndef _ASTERISK_CHAN_DAHDI_H
30#define _ASTERISK_CHAN_DAHDI_H
32#if defined(HAVE_OPENR2)
36#include <dahdi/user.h>
37#include <dahdi/tonezone.h>
44#if defined(__cplusplus) || defined(c_plusplus)
120 DAHDI_IFLIST_NO_B_CHAN,
519#if defined(HAVE_PRI) || defined(HAVE_SS7)
627 struct dahdi_echocanparams
head;
628 struct dahdi_echocanparam
params[DAHDI_MAX_ECHOCANPARAMS];
696 struct dahdi_dialoperation
dop;
714#ifdef HAVE_DAHDI_LINEREVERSE_VMWI
715 struct dahdi_vmwi_info mwisend_setting;
716 unsigned int mwisend_fsk: 1;
743#if defined(HAVE_OPENR2)
744 struct dahdi_mfcr2 *mfcr2;
745 openr2_chan_t *r2chan;
746 openr2_calling_party_category_t mfcr2_recvd_category;
747 openr2_calling_party_category_t mfcr2_category;
748 int mfcr2_dnis_index;
750 unsigned int mfcr2call:1;
751 unsigned int mfcr2_answer_pending:1;
752 unsigned int mfcr2_charge_calls:1;
753 unsigned int mfcr2_allow_collect_calls:1;
754 unsigned int mfcr2_forced_release:1;
755 unsigned int mfcr2_dnis_matched:1;
756 unsigned int mfcr2_call_accepted:1;
757 unsigned int mfcr2_accept_on_offer:1;
758 unsigned int mfcr2_progress_sent:1;
777#define SIG_EM DAHDI_SIG_EM
778#define SIG_EMWINK (0x0100000 | DAHDI_SIG_EM)
779#define SIG_FEATD (0x0200000 | DAHDI_SIG_EM)
780#define SIG_FEATDMF (0x0400000 | DAHDI_SIG_EM)
781#define SIG_FEATB (0x0800000 | DAHDI_SIG_EM)
782#define SIG_E911 (0x1000000 | DAHDI_SIG_EM)
783#define SIG_FEATDMF_TA (0x2000000 | DAHDI_SIG_EM)
784#define SIG_FGC_CAMA (0x4000000 | DAHDI_SIG_EM)
785#define SIG_FGC_CAMAMF (0x8000000 | DAHDI_SIG_EM)
786#define SIG_FXSLS DAHDI_SIG_FXSLS
787#define SIG_FXSGS DAHDI_SIG_FXSGS
788#define SIG_FXSKS DAHDI_SIG_FXSKS
789#define SIG_FXOLS DAHDI_SIG_FXOLS
790#define SIG_FXOGS DAHDI_SIG_FXOGS
791#define SIG_FXOKS DAHDI_SIG_FXOKS
792#define SIG_SF DAHDI_SIG_SF
793#define SIG_SFWINK (0x0100000 | DAHDI_SIG_SF)
794#define SIG_SF_FEATD (0x0200000 | DAHDI_SIG_SF)
795#define SIG_SF_FEATDMF (0x0400000 | DAHDI_SIG_SF)
796#define SIG_SF_FEATB (0x0800000 | DAHDI_SIG_SF)
797#define SIG_EM_E1 DAHDI_SIG_EM_E1
800#define SIG_PRI DAHDI_SIG_CLEAR
801#define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR)
802#define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR)
805#define SIG_SS7 (0x1000000 | DAHDI_SIG_CLEAR)
808#define SIG_MFCR2 DAHDI_SIG_CAS
811#define SIG_PRI_LIB_HANDLE_CASES \
843 switch (signalling) {
882#define dahdi_get_index(ast, p, nullok) _dahdi_get_index(ast, p, nullok, __PRETTY_FUNCTION__, __LINE__)
897#if defined(__cplusplus) || defined(c_plusplus)
static int dahdi_sig_pri_lib_handles(int signaling)
static int dahdi_analog_lib_handles(int signalling, int radio, int oprmode)
#define SIG_PRI_LIB_HANDLE_CASES
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[]
int _dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok, const char *fname, unsigned long line)
General Asterisk PBX channel definitions.
unsigned long long ast_group_t
#define AST_MAX_ACCOUNT_CODE
#define AST_MAX_EXTENSION
Convenient Signal Processing routines.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
#define AST_MAX_MAILBOX_UNIQUEID
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
Structure for mutex and tracking information.
Structure for variables, used for configurations and for channel variables.
struct ringContextData ringContext[3]
struct distRingData ringnum[3]
unsigned int echocanon
TRUE if echo cancellation is turned on.
char dialdest[256]
Delayed dialing for E911. Overlap digits for ISDN.
unsigned int immediate
TRUE if the channel should be answered immediately without attempting to gather any digits.
unsigned int immediatering
TRUE if audible ringback should be provided when immediate = yes.
unsigned int threewaysilenthold
TRUE if a three way dial tone should time out to silence.
enum DAHDI_IFLIST which_iflist
unsigned int permcallwaiting
TRUE if busy extensions will hear the call-waiting tone and can use hook-flash to switch between call...
float cid_rxgain
Amount of gain to increase during caller id.
struct dahdi_distRings drings
Distinctive Ring data.
struct ast_variable * vars
Channel variable list with associated values to set when a channel is created.
char cid_subaddr[AST_MAX_EXTENSION]
Caller ID subaddress from an incoming call.
unsigned int canpark
TRUE if support for call parking is enabled.
unsigned int bufferoverrideinuse
int law
Active PCM encoding format: DAHDI_LAW_ALAW or DAHDI_LAW_MULAW.
unsigned int hwtxgain_enabled
TRUE if hardware Tx gain set by Asterisk.
unsigned int dnd
TRUE if Do-Not-Disturb is enabled, present only for non sig_analog.
unsigned int ignoredtmf
TRUE if DTMF detection is disabled.
struct dahdi_dialoperation dop
DAHDI dial operation command struct for ioctl() call.
struct timeval dtmfcid_delay
unsigned int dahditrcallerid
TRUE if we should use the callerid from incoming call on dahdi transfer.
unsigned int doreoriginate
Internal flag for if we should actually process a reorigination.
unsigned char * cidspill
Analog caller ID waveform sample buffer.
int waitfordialtonetemp
Transient variable. Same as waitfordialtone, but temporarily set for a specific call,...
int cidlen
Length of the cidspill buffer containing samples.
int polarityonanswerdelay
Minimal time period (ms) between the answer polarity switch and hangup polarity switch.
int busycount
Number of times to see "busy" tone before hanging up.
char cid_num[AST_MAX_EXTENSION]
Caller ID number from an incoming call.
int ringt
Ring timeout timer??
struct ast_mwi_subscriber * mwi_event_sub
Opaque event subscription parameters for message waiting indication support.
ast_group_t group
Bitmapped groups this belongs to.
int sendcalleridafter
Send caller ID on FXS after this many rings. Set to 1 for US.
struct dahdi_pvt * oprpeer
unsigned int permhidecallerid
TRUE if the outgoing caller ID is blocked/restricted/hidden.
unsigned int mwisendactive
TRUE if a MWI message sending thread is active.
struct mwisend_info mwisend_data
int interdigit_timeout
Time (ms) to detect following digits (in an analog phone)
unsigned int mwimonitor_rpas
TRUE if the FXO port monitors for rpas precursor to fsk MWI indications from the other end.
struct dahdi_pvt * master
unsigned int confirmanswer
TRUE if to wait for a DTMF digit to confirm answer.
unsigned int restartpending
unsigned int mwimonitoractive
TRUE if an MWI monitor thread is currently active.
unsigned int outgoing
TRUE if we originated the call leg.
unsigned int faxdetect_timeout
The number of seconds into call to disable fax detection. (0 = disabled)
unsigned int callwaitingcallerid
TRUE if send caller ID for Call Waiting.
unsigned int manages_span_alarms
TRUE if the channel alarms will be managed also as Span ones.
unsigned int ani_wink_time
INTEGER, length of time to wait before sending ANI wink in ms.
int waitfordialtone
Number of milliseconds to wait for dialtone.
unsigned int locallyblocked
Bitmask for the channel being locally blocked.
unsigned int adsi
TRUE if ADSI (Analog Display Services Interface) available.
unsigned int usedistinctiveringdetection
TRUE if distinctive rings are to be detected.
unsigned int answeronpolarityswitch
TRUE if we can use a polarity reversal to mark when an outgoing call is answered by the remote party.
unsigned int threewaycalling
TRUE if three way calling is enabled.
struct dahdi_subchannel subs[3]
struct dahdi_confinfo saveconf
unsigned int use_callingpres
TRUE if we will use the calling presentation setting from the Asterisk channel for outgoing calls.
unsigned int pulse
TRUE if we will pulse dial.
int dialtone_scanning_time_elapsed
unsigned int priexclusive
TRUE if PRI B channels are always exclusively selected.
char mailbox[AST_MAX_MAILBOX_UNIQUEID]
Voice mailbox location.
float hwrxgain
Hardware Rx gain set by chan_dahdi.conf.
int echotraining
Echo training time. 0 = disabled.
struct dahdi_subchannel sub_unused
char callwait_num[AST_MAX_EXTENSION]
Call waiting number.
float hwtxgain
Hardware Tx gain set by chan_dahdi.conf.
int waitfordialtoneduration
Transient variable. Stored off waitfordialtone duration at runtime.
int dsp_features
DSP feature flags: DSP_FEATURE_xxx.
unsigned int callwaiting
TRUE if busy extensions will hear the call-waiting tone and can use hook-flash to switch between call...
char exten[AST_MAX_EXTENSION]
Extension to use in the dialplan.
int callprogress
Bitmapped call progress detection flags. CALLPROGRESS_xxx values.
int callwaitcas
TRUE if Call Waiting (CW) CPE Alert Signal (CAS) is being sent.
struct timeval polaritydelaytv
Start delay time if polarityonanswerdelay is nonzero.
unsigned int hanguponpolarityswitch
TRUE if the call will be considered "hung up" on a polarity reversal.
char dnid[AST_MAX_EXTENSION]
Dialed Number Identifier.
char dialstring[AST_CHANNEL_NAME]
char call_forward[AST_MAX_EXTENSION]
Accumulated call forwarding number.
char description[32]
A description for the channel configuration.
unsigned int firstradio
TRUE if over a radio and dahdi_read() has been called.
unsigned int remotelyblocked
Bitmask for the channel being remotely blocked. 1 maintenance, 2 blocked in hardware.
struct dahdi_pvt::@115 echocancel
Echo cancel parameters.
unsigned int hidecallerid
TRUE if the outgoing caller ID is blocked/hidden.
unsigned int echobreak
XXX BOOLEAN Purpose???
struct dahdi_echocanparam params[DAHDI_MAX_ECHOCANPARAMS]
unsigned int callreturn
TRUE if call return is enabled. (*69, if your dialplan doesn't catch this first)
struct ast_namedgroups * named_pickupgroups
Named pickup groups this belongs to.
struct ast_channel * owner
char rdnis[AST_MAX_EXTENSION]
Redirecting Directory Number Information Service (RDNIS) number.
unsigned int faxhandled
TRUE if a fax tone has already been handled.
unsigned int use_smdi
TRUE if SMDI (Simplified Message Desk Interface) is enabled.
struct callerid_state * cs
int cid_ani2
Automatic Number Identification code from PRI.
struct ast_namedgroups * named_callgroups
Named call groups this belongs to.
int callwaitrings
Number of call waiting rings.
unsigned int mwimonitor_neon
TRUE if the FXO port monitors for neon type MWI indications from the other end.
unsigned int dialednone
TRUE if analog type line dialed no digits in Dial()
unsigned int hwrxgain_enabled
TRUE if hardware Rx gain set by Asterisk.
int law_default
Default call PCM encoding format: DAHDI_LAW_ALAW or DAHDI_LAW_MULAW.
int fake_event
Holding place for event injected from outside normal operation.
char echorest[20]
Filled with 'w'. XXX Purpose??
struct dahdi_pvt * slaves[MAX_SLAVES]
unsigned int ani_timeout
INTEGER, length of ANI failure timeout in ms.
int dtmfcid_holdoff_state
unsigned int mwioverride_active
TRUE if a manual MWI override is active for a channel.
unsigned int mwimonitor_fsk
TRUE if the FXO port monitors for fsk type MWI indications from the other end.
int ringt_base
Ring timeout base.
unsigned int destroy
TRUE if the channel is to be destroyed on hangup. (Used by pseudo channels.)
unsigned int restrictcid
TRUE if caller ID is restricted.
char defcontext[AST_MAX_CONTEXT]
Default distinctive ring context.
unsigned int priindication_oob
TRUE if PRI congestion/busy indications are sent out-of-band.
unsigned int ani_info_digits
INTEGER, number of ANI INFO digits on a CAMA trunk. older switches use 1 INFO digit,...
unsigned int busydetect
TRUE if busy detection is enabled. (Listens for the beep-beep busy pattern.)
unsigned int hidecalleridname
TRUE if hide just the name not the number for legacy PBX use.
struct timeval waitingfordt
struct ast_dsp * dsp
Opaque DSP configuration structure.
ast_group_t pickupgroup
Bitmapped pickup groups this belongs to.
unsigned int reoriginate
TRUE if FXS (FXO-signalled) channel should reoriginate for user to make a new call.
int cidpos
Position in the cidspill buffer to send out next.
char context[AST_MAX_CONTEXT]
The configured context for incoming calls.
unsigned int cancallforward
TRUE if support for call forwarding enabled. Dial *72 to enable call forwarding. Dial *73 to disable ...
int radio
Nonzero if the signaling type is sent over a radio.
char parkinglot[AST_MAX_EXTENSION]
unsigned int hardwaredtmf
TRUE if DTMF detection needs to be done by hardware.
char begindigit
DTMF digit in progress. 0 when no digit in progress.
struct ast_cc_config_params * cc_params
unsigned int mate
TRUE if TDD in MATE mode.
float txgain
Software Tx gain set by chan_dahdi.conf.
int firstdigit_timeout
Time (ms) to detect first digit (in an analog phone)
struct dahdi_echocanparams head
unsigned int echocanbridged
TRUE if echo cancellation enabled when bridged.
char finaldial[64]
Second part of SIG_FEATDMF_TA wink operation.
unsigned int transfer
TRUE if call transfer is enabled.
unsigned int transfertobusy
TRUE if allowed to flash-transfer to busy channels.
unsigned int inalarm
TRUE if in an alarm condition.
char cid_name[AST_MAX_EXTENSION]
Caller ID name from an incoming call.
unsigned int inservice
TRUE if channel is out of reset and ready.
char language[MAX_LANGUAGE]
Language configured for calls.
unsigned int digital
TRUE if the transfer capability of the call is digital.
char accountcode[AST_MAX_ACCOUNT_CODE]
unsigned int mwioverride_disposition
Manual MWI disposition (on/off)
struct ast_dsp_busy_pattern busy_cadence
Busy cadence pattern description.
int stripmsd
Number of most significant digits/characters to strip from the dialed number.
unsigned int pulsedial
TRUE if a pulsed digit was detected. (Pulse dial phone detected)
unsigned int calledsubscriberheld
TRUE if Called Subscriber held is enabled. This allows a single incoming call to hold a DAHDI channel...
int muting
TRUE if confrence is muted.
char cid_tag[AST_MAX_EXTENSION]
Caller ID tag from incoming call.
int matchdigit_timeout
Time (ms) to wait, in case of ambiguous match (in an analog phone)
char mohsuggest[MAX_MUSICCLASS]
Suggested music-on-hold class for peer channel to use for calls.
unsigned int use_callerid
TRUE if caller ID is used on this channel.
float rxgain
Software Rx gain set by chan_dahdi.conf.
int polarity
Current line interface polarity. POLARITY_IDLE, POLARITY_REV.
ast_group_t callgroup
Bitmapped call groups this belongs to.
unsigned int dialing
TRUE if in the process of dialing digits or sending something.
unsigned int usefaxbuffers
char callwait_name[AST_MAX_EXTENSION]
Call waiting name.
char mohinterpret[MAX_MUSICCLASS]
The configured music-on-hold class to use for calls.
int dialtone_detect
Number of frames to watch for dialtone in incoming calls.
struct ast_smdi_interface * smdi_iface
The SMDI interface to get SMDI messages from.
int cid_ton
Caller ID Q.931 TON/NPI field values. Set by PRI. Zero otherwise.
struct ast_channel * owner
struct dahdi_confinfo curconf
short buffer[AST_FRIENDLY_OFFSET/2+READ_SIZE]
unsigned int needcongestion
mwisend_states mwisend_current
char contextData[AST_MAX_CONTEXT]