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) 58 #define SUB_CALLWAIT 1 59 #define SUB_THREEWAY 2 75 extern const char *
const subnames[];
92 struct dahdi_confinfo curconf;
111 struct timeval pause;
119 #if defined(HAVE_PRI) 120 DAHDI_IFLIST_NO_B_CHAN,
132 struct dahdi_confinfo saveconf;
424 #if defined(HAVE_PRI) 449 char description[32];
472 #if defined(HAVE_PRI) || defined(HAVE_SS7) 544 struct timeval dtmfcid_delay;
580 struct dahdi_echocanparams head;
581 struct dahdi_echocanparam params[DAHDI_MAX_ECHOCANPARAMS];
636 struct timeval waitingfordt;
637 struct timeval flashtime;
641 struct dahdi_dialoperation dop;
659 #ifdef HAVE_DAHDI_LINEREVERSE_VMWI 660 struct dahdi_vmwi_info mwisend_setting;
661 unsigned int mwisend_fsk: 1;
674 struct timeval polaritydelaytv;
684 #if defined(HAVE_SS7) 688 #if defined(HAVE_OPENR2) 689 struct dahdi_mfcr2 *mfcr2;
690 openr2_chan_t *r2chan;
691 openr2_calling_party_category_t mfcr2_recvd_category;
692 openr2_calling_party_category_t mfcr2_category;
693 int mfcr2_dnis_index;
695 unsigned int mfcr2call:1;
696 unsigned int mfcr2_answer_pending:1;
697 unsigned int mfcr2_charge_calls:1;
698 unsigned int mfcr2_allow_collect_calls:1;
699 unsigned int mfcr2_forced_release:1;
700 unsigned int mfcr2_dnis_matched:1;
701 unsigned int mfcr2_call_accepted:1;
702 unsigned int mfcr2_accept_on_offer:1;
703 unsigned int mfcr2_progress_sent:1;
722 #define SIG_EM DAHDI_SIG_EM 723 #define SIG_EMWINK (0x0100000 | DAHDI_SIG_EM) 724 #define SIG_FEATD (0x0200000 | DAHDI_SIG_EM) 725 #define SIG_FEATDMF (0x0400000 | DAHDI_SIG_EM) 726 #define SIG_FEATB (0x0800000 | DAHDI_SIG_EM) 727 #define SIG_E911 (0x1000000 | DAHDI_SIG_EM) 728 #define SIG_FEATDMF_TA (0x2000000 | DAHDI_SIG_EM) 729 #define SIG_FGC_CAMA (0x4000000 | DAHDI_SIG_EM) 730 #define SIG_FGC_CAMAMF (0x8000000 | DAHDI_SIG_EM) 731 #define SIG_FXSLS DAHDI_SIG_FXSLS 732 #define SIG_FXSGS DAHDI_SIG_FXSGS 733 #define SIG_FXSKS DAHDI_SIG_FXSKS 734 #define SIG_FXOLS DAHDI_SIG_FXOLS 735 #define SIG_FXOGS DAHDI_SIG_FXOGS 736 #define SIG_FXOKS DAHDI_SIG_FXOKS 737 #define SIG_SF DAHDI_SIG_SF 738 #define SIG_SFWINK (0x0100000 | DAHDI_SIG_SF) 739 #define SIG_SF_FEATD (0x0200000 | DAHDI_SIG_SF) 740 #define SIG_SF_FEATDMF (0x0400000 | DAHDI_SIG_SF) 741 #define SIG_SF_FEATB (0x0800000 | DAHDI_SIG_SF) 742 #define SIG_EM_E1 DAHDI_SIG_EM_E1 745 #define SIG_PRI DAHDI_SIG_CLEAR 746 #define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR) 747 #define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR) 750 #define SIG_SS7 (0x1000000 | DAHDI_SIG_CLEAR) 753 #define SIG_MFCR2 DAHDI_SIG_CAS 756 #define SIG_PRI_LIB_HANDLE_CASES \ 788 switch (signalling) {
827 #define dahdi_get_index(ast, p, nullok) _dahdi_get_index(ast, p, nullok, __PRETTY_FUNCTION__, __LINE__) 842 #if defined(__cplusplus) || defined(c_plusplus) int cidpos
Position in the cidspill buffer to send out next.
unsigned int outgoing
TRUE if we originated the call leg.
unsigned int digital
TRUE if the transfer capability of the call is digital.
int dialtone_scanning_time_elapsed
unsigned long long ast_group_t
int matchdigit_timeout
Time (ms) to wait, in case of ambiguous match (in an analog phone)
unsigned int priexclusive
TRUE if PRI B channels are always exclusively selected.
static char accountcode[AST_MAX_ACCOUNT_CODE]
static char mohinterpret[MAX_MUSICCLASS]
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
void dahdi_master_slave_unlink(struct dahdi_pvt *slave, struct dahdi_pvt *master, int needlock)
unsigned int permhidecallerid
TRUE if the outgoing caller ID is blocked/restricted/hidden.
unsigned int cancallforward
TRUE if support for call forwarding enabled. Dial *72 to enable call forwarding. Dial *73 to disable ...
int cid_ton
Caller ID Q.931 TON/NPI field values. Set by PRI. Zero otherwise.
struct ast_namedgroups * named_pickupgroups
Named pickup groups this belongs to.
static int dahdi_sig_pri_lib_handles(int signaling)
unsigned int callwaiting
TRUE if busy extensions will hear the call-waiting tone and can use hook-flash to switch between call...
int callwaitcas
TRUE if Call Waiting (CW) CPE Alert Signal (CAS) is being sent.
static char parkinglot[AST_MAX_CONTEXT]
int firstdigit_timeout
Time (ms) to detect first digit (in an analog phone)
unsigned int dialing
TRUE if in the process of dialing digits or sending something.
int callwaitrings
Number of call waiting rings.
void dahdi_master_slave_link(struct dahdi_pvt *slave, struct dahdi_pvt *master)
unsigned int callwaitingcallerid
TRUE if send caller ID for Call Waiting.
unsigned int hardwaredtmf
TRUE if DTMF detection needs to be done by hardware.
int interdigit_timeout
Time (ms) to detect following digits (in an analog phone)
static int dahdi_analog_lib_handles(int signalling, int radio, int oprmode)
int ringt
Ring timeout timer??
Convenient Signal Processing routines.
unsigned int firstradio
TRUE if over a radio and dahdi_read() has been called.
struct dahdi_pvt * master
void dahdi_conf_update(struct dahdi_pvt *p)
struct ast_mwi_subscriber * mwi_event_sub
Opaque event subscription parameters for message waiting indication support.
unsigned int locallyblocked
Bitmask for the channel being locally blocked.
unsigned int inservice
TRUE if channel is out of reset and ready.
struct ast_channel * owner
Structure for variables, used for configurations and for channel variables.
int dsp_features
DSP feature flags: DSP_FEATURE_xxx.
mwisend_states mwisend_current
unsigned int dahditrcallerid
TRUE if we should use the callerid from incoming call on dahdi transfer.
unsigned int dnd
TRUE if Do-Not-Disturb is enabled, present only for non sig_analog.
unsigned int usefaxbuffers
int law_default
Default call PCM encoding format: DAHDI_LAW_ALAW or DAHDI_LAW_MULAW.
unsigned int immediate
TRUE if the channel should be answered immediately without attempting to gather any digits...
float cid_rxgain
Amount of gain to increase during caller id.
unsigned int transfertobusy
TRUE if allowed to flash-transfer to busy channels.
int law
Active PCM encoding format: DAHDI_LAW_ALAW or DAHDI_LAW_MULAW.
unsigned int adsi
TRUE if ADSI (Analog Display Services Interface) available.
unsigned int restartpending
struct dahdi_pvt * oprpeer
int ringt_base
Ring timeout base.
float txgain
Software Tx gain set by chan_dahdi.conf.
static char cid_num[AST_MAX_EXTENSION]
unsigned int hidecalleridname
TRUE if hide just the name not the number for legacy PBX use.
int _dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok, const char *fname, unsigned long line)
unsigned int pulse
TRUE if we will pulse dial.
#define AST_MAX_MAILBOX_UNIQUEID
ast_group_t pickupgroup
Bitmapped pickup groups this belongs to.
unsigned int hwtxgain_enabled
TRUE if hardware Tx gain set by Asterisk.
#define AST_MAX_ACCOUNT_CODE
unsigned int answeronpolarityswitch
TRUE if we can use a polarity reversal to mark when an outgoing call is answered by the remote party...
static char mailbox[AST_MAX_MAILBOX_UNIQUEID]
int dtmfcid_holdoff_state
unsigned int bufferoverrideinuse
int polarity
Current line interface polarity. POLARITY_IDLE, POLARITY_REV.
unsigned int hanguponpolarityswitch
TRUE if the call will be considered "hung up" on a polarity reversal.
unsigned int callreturn
TRUE if call return is enabled. (*69, if your dialplan doesn't catch this first)
unsigned int transfer
TRUE if call transfer is enabled.
unsigned int echobreak
XXX BOOLEAN Purpose???
struct ast_cc_config_params * cc_params
General Asterisk PBX channel definitions.
struct dahdi_pvt * slaves[MAX_SLAVES]
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
int cidlen
Length of the cidspill buffer containing samples.
unsigned int mwimonitoractive
TRUE if an MWI monitor thread is currently active.
int echotraining
Echo training time. 0 = disabled.
static char mohsuggest[MAX_MUSICCLASS]
#define AST_MAX_EXTENSION
int cid_ani2
Automatic Number Identification code from PRI.
unsigned char * cidspill
Analog caller ID waveform sample buffer.
unsigned int permcallwaiting
TRUE if busy extensions will hear the call-waiting tone and can use hook-flash to switch between call...
void dahdi_dtmf_detect_enable(struct dahdi_pvt *p)
struct ast_channel * owner
void dahdi_ec_disable(struct dahdi_pvt *p)
unsigned int busydetect
TRUE if busy detection is enabled. (Listens for the beep-beep busy pattern.)
static char language[MAX_LANGUAGE]
unsigned int mwimonitor_fsk
TRUE if the FXO port monitors for fsk type MWI indications from the other end.
unsigned int use_callingpres
TRUE if we will use the calling presentation setting from the Asterisk channel for outgoing calls...
unsigned int use_smdi
TRUE if SMDI (Simplified Message Desk Interface) is enabled.
struct ast_dsp * dsp
Opaque DSP configuration structure.
int busycount
Number of times to see "busy" tone before hanging up.
unsigned int destroy
TRUE if the channel is to be destroyed on hangup. (Used by pseudo channels.)
unsigned int faxhandled
TRUE if a fax tone has already been handled.
enum DAHDI_IFLIST which_iflist
unsigned int use_callerid
TRUE if caller ID is used on this channel.
void dahdi_dtmf_detect_disable(struct dahdi_pvt *p)
#define SIG_PRI_LIB_HANDLE_CASES
int muting
TRUE if confrence is muted.
unsigned int usedistinctiveringdetection
TRUE if distinctive rings are to be detected.
unsigned int faxdetect_timeout
The number of seconds into call to disable fax detection. (0 = disabled)
unsigned int restrictcid
TRUE if caller ID is restricted.
unsigned int remotelyblocked
Bitmask for the channel being remotely blocked. 1 maintenance, 2 blocked in hardware.
struct callerid_state * cs
unsigned int threewaycalling
TRUE if three way calling is enabled.
int stripmsd
Number of most significant digits/characters to strip from the dialed number.
struct ast_namedgroups * named_callgroups
Named call groups this belongs to.
struct ast_smdi_interface * smdi_iface
The SMDI interface to get SMDI messages from.
static char cid_name[AST_MAX_EXTENSION]
unsigned int ignoredtmf
TRUE if DTMF detection is disabled.
const char *const subnames[]
int fake_event
Holding place for event injected from outside normal operation.
unsigned int confirmanswer
TRUE if to wait for a DTMF digit to confirm answer.
unsigned int mwimonitor_neon
TRUE if the FXO port monitors for neon type MWI indications from the other end.
int waitfordialtone
Number of milliseconds to wait for dialtone.
float hwtxgain
Hardware Tx gain set by chan_dahdi.conf.
unsigned int echocanon
TRUE if echo cancellation is turned on.
unsigned int needcongestion
struct ast_variable * vars
Channel variable list with associated values to set when a channel is created.
unsigned int dialednone
TRUE if analog type line dialed no digits in Dial()
Data structure associated with a single frame of data.
unsigned int manages_span_alarms
TRUE if the channel alarms will be managed also as Span ones.
unsigned int priindication_oob
TRUE if PRI congestion/busy indications are sent out-of-band.
unsigned int hidecallerid
TRUE if the outgoing caller ID is blocked/hidden.
unsigned int echocanbridged
TRUE if echo cancellation enabled when bridged.
int polarityonanswerdelay
Minimal time period (ms) between the answer polarity switch and hangup polarity switch.
float rxgain
Software Rx gain set by chan_dahdi.conf.
static char context[AST_MAX_CONTEXT]
int radio
Nonzero if the signaling type is sent over a radio.
void dahdi_ec_enable(struct dahdi_pvt *p)
int callprogress
Bitmapped call progress detection flags. CALLPROGRESS_xxx values.
float hwrxgain
Hardware Rx gain set by chan_dahdi.conf.
unsigned int hwrxgain_enabled
TRUE if hardware Rx gain set by Asterisk.
ast_group_t group
Bitmapped groups this belongs to.
int dialtone_detect
Number of frames to watch for dialtone in incoming calls.
unsigned int inalarm
TRUE if in an alarm condition.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
int sendcalleridafter
Send caller ID on FXS after this many rings. Set to 1 for US.
ast_group_t callgroup
Bitmapped call groups this belongs to.
unsigned int mate
TRUE if TDD in MATE mode.
unsigned int canpark
TRUE if support for call parking is enabled.
Structure for mutex and tracking information.
unsigned int pulsedial
TRUE if a pulsed digit was detected. (Pulse dial phone detected)
char begindigit
DTMF digit in progress. 0 when no digit in progress.
unsigned int mwimonitor_rpas
TRUE if the FXO port monitors for rpas precursor to fsk MWI indications from the other end...
unsigned int mwisendactive
TRUE if a MWI message sending thread is active.