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[];
83 unsigned int needringing:1;
84 unsigned int needbusy:1;
85 unsigned int needcongestion:1;
86 unsigned int needanswer:1;
87 unsigned int needflash:1;
88 unsigned int needhold:1;
89 unsigned int needunhold:1;
90 unsigned int linear:1;
91 unsigned int inthreeway:1;
92 struct dahdi_confinfo curconf;
111 struct timeval pause;
112 mwisend_states mwisend_current;
119 #if defined(HAVE_PRI)
471 #if defined(HAVE_PRI)
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
716 unsigned int mwisend_fsk: 1;
739 #if defined(HAVE_SS7)
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 \
825 static inline int dahdi_sig_pri_lib_handles(
int signaling)
830 case SIG_PRI_LIB_HANDLE_CASES:
841 static inline int dahdi_analog_lib_handles(
int signalling,
int radio,
int oprmode)
843 switch (signalling) {
882 #define dahdi_get_index(ast, p, nullok) _dahdi_get_index(ast, p, nullok, __PRETTY_FUNCTION__, __LINE__)
883 int _dahdi_get_index(
struct ast_channel *ast,
struct dahdi_pvt *p,
int nullok,
const char *fname,
unsigned long line);
885 void dahdi_dtmf_detect_disable(
struct dahdi_pvt *p);
886 void dahdi_dtmf_detect_enable(
struct dahdi_pvt *p);
888 void dahdi_ec_enable(
struct dahdi_pvt *p);
889 void dahdi_ec_disable(
struct dahdi_pvt *p);
891 void dahdi_conf_update(
struct dahdi_pvt *p);
893 void dahdi_master_slave_unlink(
struct dahdi_pvt *slave,
struct dahdi_pvt *master,
int needlock);
897 #if defined(__cplusplus) || defined(c_plusplus)
int cidpos
Position in the cidspill buffer to send out next.
char defcontext[AST_MAX_CONTEXT]
Default distinctive ring context.
unsigned int digital
TRUE if the transfer capability of the call is digital.
int dialtone_scanning_time_elapsed
int matchdigit_timeout
Time (ms) to wait, in case of ambiguous match (in an analog phone)
char description[32]
A description for the channel configuration.
unsigned int priexclusive
TRUE if PRI B channels are always exclusively selected.
Main Channel structure associated with a channel.
struct dahdi_dialoperation dop
DAHDI dial operation command struct for ioctl() call.
char cid_subaddr[AST_MAX_EXTENSION]
Caller ID subaddress from an incoming call.
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.
unsigned int reoriginate
TRUE if FXS (FXO-signalled) channel should reoriginate for user to make a new call.
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.
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.
struct dahdi_subchannel subs[3]
int callwaitrings
Number of call waiting rings.
char parkinglot[AST_MAX_EXTENSION]
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)
int ringt
Ring timeout timer??
char dnid[AST_MAX_EXTENSION]
Dialed Number Identifier.
Convenient Signal Processing routines.
unsigned int firstradio
TRUE if over a radio and dahdi_read() has been called.
struct dahdi_pvt * master
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.
char callwait_name[AST_MAX_EXTENSION]
Call waiting name.
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.
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...
unsigned int immediatering
TRUE if audible ringback should be provided when immediate = yes.
float cid_rxgain
Amount of gain to increase during caller id.
struct ast_dsp_busy_pattern busy_cadence
Busy cadence pattern description.
unsigned int ani_wink_time
INTEGER, length of time to wait before sending ANI wink in ms.
unsigned int transfertobusy
TRUE if allowed to flash-transfer to busy channels.
unsigned int ani_info_digits
INTEGER, number of ANI INFO digits on a CAMA trunk. older switches use 1 INFO digit, newer switches use 2 INFO digits.
int law
Active PCM encoding format: DAHDI_LAW_ALAW or DAHDI_LAW_MULAW.
unsigned int mwioverride_active
TRUE if a manual MWI override is active for a channel.
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.
struct timeval dtmfcid_delay
unsigned int hidecalleridname
TRUE if hide just the name not the number for legacy PBX use.
unsigned int pulse
TRUE if we will pulse dial.
ast_group_t pickupgroup
Bitmapped pickup groups this belongs to.
char cid_name[AST_MAX_EXTENSION]
Caller ID name from an incoming call.
char finaldial[64]
Second part of SIG_FEATDMF_TA wink operation.
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...
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???
General Asterisk PBX channel definitions.
struct dahdi_pvt * slaves[MAX_SLAVES]
struct dahdi_pvt::@112 echocancel
Echo cancel parameters.
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
char mailbox[AST_MAX_MAILBOX_UNIQUEID]
Voice mailbox location.
char echorest[20]
Filled with 'w'. XXX Purpose??
int cidlen
Length of the cidspill buffer containing samples.
struct dahdi_confinfo saveconf
unsigned int mwimonitoractive
TRUE if an MWI monitor thread is currently active.
int echotraining
Echo training time. 0 = disabled.
#define AST_MAX_EXTENSION
int cid_ani2
Automatic Number Identification code from PRI.
struct dahdi_vmwi_info mwisend_setting
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...
unsigned int busydetect
TRUE if busy detection is enabled. (Listens for the beep-beep busy pattern.)
unsigned int mwimonitor_fsk
TRUE if the FXO port monitors for fsk type MWI indications from the other end.
struct dahdi_subchannel sub_unused
unsigned int use_callingpres
TRUE if we will use the calling presentation setting from the Asterisk channel for outgoing calls...
char cid_tag[AST_MAX_EXTENSION]
Caller ID tag from incoming call.
unsigned int calledsubscriberheld
TRUE if Called Subscriber held is enabled. This allows a single incoming call to hold a DAHDI channel...
unsigned int use_smdi
TRUE if SMDI (Simplified Message Desk Interface) is enabled.
unsigned int threewaysilenthold
TRUE if a three way dial tone should time out to silence.
int waitfordialtoneduration
Transient variable. Stored off waitfordialtone duration at runtime.
struct timeval waitingfordt
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.
char mohinterpret[MAX_MUSICCLASS]
The configured music-on-hold class to use for calls.
char cid_num[AST_MAX_EXTENSION]
Caller ID number from an incoming call.
enum DAHDI_IFLIST which_iflist
unsigned int use_callerid
TRUE if caller ID is used on this channel.
char exten[AST_MAX_EXTENSION]
Extension to use in the dialplan.
int muting
TRUE if confrence is muted.
unsigned int usedistinctiveringdetection
TRUE if distinctive rings are to be detected.
char call_forward[AST_MAX_EXTENSION]
Accumulated call forwarding number.
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.
char context[AST_MAX_CONTEXT]
The configured context for incoming calls.
unsigned int remotelyblocked
Bitmask for the channel being remotely blocked. 1 maintenance, 2 blocked in hardware.
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.
unsigned int ignoredtmf
TRUE if DTMF detection is disabled.
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.
int waitfordialtonetemp
Transient variable. Same as waitfordialtone, but temporarily set for a specific call, rather than permanently for the channel.
struct dahdi_distRings drings
Distinctive Ring data.
unsigned int echocanon
TRUE if echo cancellation is turned on.
unsigned int doreoriginate
Internal flag for if we should actually process a reorigination.
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.
struct timeval polaritydelaytv
Start delay time if polarityonanswerdelay is nonzero.
char callwait_num[AST_MAX_EXTENSION]
Call waiting number.
unsigned int hidecallerid
TRUE if the outgoing caller ID is blocked/hidden.
char cid_ani[AST_MAX_EXTENSION]
Automatic Number Identification number (Alternate PRI caller ID number)
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.
int radio
Nonzero if the signaling type is sent over a radio.
char rdnis[AST_MAX_EXTENSION]
Redirecting Directory Number Information Service (RDNIS) number.
int callprogress
Bitmapped call progress detection flags. CALLPROGRESS_xxx values.
float hwrxgain
Hardware Rx gain set by chan_dahdi.conf.
char language[MAX_LANGUAGE]
Language configured for calls.
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.
char dialdest[256]
Delayed dialing for E911. Overlap digits for ISDN.
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 ani_timeout
INTEGER, length of ANI failure timeout in ms.
unsigned int pulsedial
TRUE if a pulsed digit was detected. (Pulse dial phone detected)
char mohsuggest[MAX_MUSICCLASS]
Suggested music-on-hold class for peer channel to use for calls.
unsigned int mwisend_rpas
char begindigit
DTMF digit in progress. 0 when no digit in progress.
unsigned int mwioverride_disposition
Manual MWI disposition (on/off)
char accountcode[AST_MAX_ACCOUNT_CODE]
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.