📄 isdnchannel.java
字号:
* Cause values
*
* NOTE: Not all cause values are universally supported across switch types.
* Before a particular cause value is used, its validity should be
* compared with the appropriate switch vendor specs.
*/
public static final int UNASSIGNED_NUMBER = 0x01; /* Cause 01 */
public static final int NO_ROUTE = 0x02; /* Cause 02 */
public static final int CHANNEL_UNACCEPTABLE = 0x06; /* Cause 06 */
public static final int NORMAL_CLEARING = 0x10; /* Cause 16 */
public static final int USER_BUSY = 0x11; /* Cause 17 */
public static final int NO_USER_RESPONDING = 0x12; /* Cause 18 */
public static final int NO_ANSWER_FROM_USER = 0x13; /* Cause 19 */
public static final int CALL_REJECTED = 0x15; /* Cause 21 */
public static final int NUMBER_CHANGED = 0x16; /* Cause 22 */
public static final int DEST_OUT_OF_ORDER = 0x1B; /* Cause 27 */
public static final int INVALID_NUMBER_FORMAT = 0x1C; /* Cause 28 */
public static final int FACILITY_REJECTED = 0x1D; /* Cause 29 */
public static final int RESP_TO_STAT_ENQ = 0x1E; /* Cause 30 */
public static final int UNSPECIFIED_CAUSE = 0x1F; /* Cause 31 */
public static final int NO_CIRCUIT_AVAILABLE = 0x22; /* Cause 34 */
public static final int NETWORK_OUT_OF_ORDER = 0x26; /* Cause 38 */
public static final int TEMPORARY_FAILURE = 0x29; /* Cause 41 */
public static final int NETWORK_CONGESTION = 0x2A; /* Cause 42 */
public static final int ACCESS_INFO_DISCARDED = 0x2B; /* Cause 43 */
public static final int REQ_CHANNEL_NOT_AVAIL = 0x2C; /* Cause 44 */
public static final int PRE_EMPTED = 0x2D; /* Cause 45 */
public static final int FACILITY_NOT_SUBSCRIBED = 0x32; /* Cause 50 */
public static final int OUTGOING_CALL_BARRED = 0x34; /* Cause 52 */
public static final int INCOMING_CALL_BARRED = 0x36; /* Cause 54 */
public static final int BEAR_CAP_NOT_AVAIL = 0x3A; /* Cause 58 */
public static final int SERVICE_NOT_AVAIL = 0x3F; /* Cause 63 */
public static final int CAP_NOT_IMPLEMENTED = 0x41; /* Cause 65 */
public static final int CHAN_NOT_IMPLEMENTED = 0x42; /* Cause 66 */
public static final int FACILITY_NOT_IMPLEMENT = 0x45; /* Cause 69 */
public static final int INVALID_CALL_REF = 0x51; /* Cause 81 */
public static final int CHAN_DOES_NOT_EXIST = 0x52; /* Cause 82 */
public static final int INCOMPATIBLE_DEST = 0x58; /* Cause 88 */
public static final int INVALID_MSG_UNSPEC = 0x5F; /* Cause 95 */
public static final int MANDATORY_IE_MISSING = 0x60; /* Cause 96 */
public static final int NONEXISTENT_MSG = 0x61; /* Cause 97 */
public static final int WRONG_MESSAGE = 0x62; /* Cause 98 */
public static final int BAD_INFO_ELEM = 0x63; /* Cause 99 */
public static final int INVALID_ELEM_CONTENTS = 0x64; /* Cause 100 */
public static final int WRONG_MSG_FOR_STATE = 0x65; /* Cause 101 */
public static final int TIMER_EXPIRY = 0x66; /* Cause 102 */
public static final int MANDATORY_IE_LEN_ERR = 0x67; /* Cause 103 */
public static final int PROTOCOL_ERROR = 0x6F; /* Cause 111 */
public static final int INTERWORKING_UNSPEC = 0x7F; /* Cause 127 */
/*
The Cause value greater than 127 is allowed to define here. There is
no conflict with those universal defines which ranges 0 - 127
*/
public static final int RESTART_ON_NON_PRIMARY = 0x80; /* Cause 128 */
/*
* CHANNEL_ID_IE
*/
public static final int ISDN_CHAN_EXCLUSIVE = 0x01;
/*
* B-Channel choices for the Channel Identification IE.
*/
public static final int B_CHANNEL_UNITS = 3; /* Chan type - single B channel */
public static final int B_CHANNEL = B_CHANNEL_UNITS; /* Borrow the ID */
public static final int CHANNEL_1X64 = B_CHANNEL; /* BEAR_RATE_64KBPS */
/*
* CONGEST_LEVEL_IE
*/
public static final int NOT_CONGESTED = 0; /* Level = NOT_CONGESTED */
public static final int CONGESTED = 0x0F; /* Level = CONGESTED */
/*
* HIGH_LAYER_COMPAT_IE
*/
/*
* Coding Standards
*/
public static final int CCITT_STANDARD = 0; /* Coding standard */
public static final int CEPT_NATIONAL_STANDARD = 2; /* CEPT/National standard */
public static final int NATIONAL_INTERPRETATION = 0; /* Interpretation value */
public static final int CCITT_CEPT_INTERPRETATION = 4; /* Interpretation value */
public static final int PROFILE_PRESENTATION = 1; /* Presentation value */
/*
* CCITT Teleservices
*/
public static final int TELEPHONY_SERVICE = 0x01; /* Teleservice */
public static final int GR3_FAX_SERVICE = 0x04; /* Teleservice */
public static final int TELETEX_MIXED_SERVICE = 0x24; /* Teleservice */
public static final int GR4_FAX_SERVICE = 0x21; /* Teleservice */
public static final int TELETEX_CHAR_SERVICE = 0x31; /* Teleservice */
public static final int ALPHA_MOS_VID_SERVICE = 0x32; /* Teleservice */
public static final int TELEX_SERVICE = 0x35; /* Teleservice */
public static final int MHS_SERVICE = 0x38; /* Teleservice */
public static final int OSI_APPL_SERVICE = 0x41; /* Teleservice */
/*
* CEPT Teleservices
*/
public static final int UNKNOWN_SERVICE = 0x00; /* Teleservice (interworking) */
/*
* National Standard Teleservices
*/
public static final int AUDIOSCRIPT_SERVICE = 0x40; /* Teleservice */
public static final int AUDIOVIDEOTEX_SERVICE = 0x48; /* Teleservice */
public static final int NON_STD_APPL_SERVICE = 0x7F; /* Teleservice */
/*
* PROGRESS_IND_IE
*/
/*
* Progress values
*/
public static final int CALL_NOT_END_TO_END_ISDN = 1; /* Progress indicator value */
public static final int IN_BAND_INFO = 8; /* Progress indicator value */
/*
* USER_USER_IE
*/
public static final int USER_SPEC_PROTO = 0x00; /* User-specific protocol */
public static final int OSI_HIGH_LAYER_PROTO = 0x01; /* OSI high layer protocol */
public static final int X244_PROTO = 0x02; /* X.244 protocol */
public static final int MAINT_MGMT_PROTO = 0x03; /* Maintenance/management protocol */
public static final int IA5_CHAR_PROTO = 0x04; /* IA5 character protocol */
public static final int V120_RATE_ADPT_PROTO = 0x07; /* V.120 rate adaption protocol */
public static final int Q931_USER_NET_PROTO = 0x08; /* Q.931 user-network protocol */
public static final int NT2_NT2_FAC_PROTO = 0x40; /* VN2 NT2-NT2 facilities protocol */
public static final int MINI_MSG_SERV_PROTO = 0x41; /* VN2 mini-msg handling protocol */
public static final int MAX_UUI_LEN = 131; /* A network-dependent value */
/*
* "update" values
*/
public static final int DATA_LINK_DOWN = 0x01; /* CC->Host data link failure report */
public static final int DATA_LINK_UP = 0x02; /* CC->Host data link restore report */
public static final int EST_DATA_LINK = 0x03; /* Host->CC data link restore request */
public static final int REL_DATA_LINK = 0x04; /* Host->CC data link restore request */
public static final int DATA_LINK_RESET = 0x05; /* CC->Host data link reset for DASS2 */
/*
* vari-a-bill
*/
public static final int FLEX_BILLING_AVAILABLE = 0x01;
public static final int FLEX_BILLING_UNAVAILABLE = 0x02;
public static final int FLEX_BILLING_ACCEPTED = 0x03;
public static final int FLEX_BILLING_BAD_OPERATION = 0x04;
public static final int FLEX_BILLING_BAD_ARGUMENT = 0x05;
public static final int FLEX_BILLING_RETURN_ERR = 0x06;
public static final int FLEX_BILLING_IE_ERR = 0x07;
public static final int NO_FLEX_BILLING_INFO = 0x08;
/*
* definitions for flex billing billing type field
*/
public static final int BILLING_NEW_RATE = 0x10;
public static final int BILLING_FLAT_RATE = 0x11;
public static final int BILLING_PREMIUM_CHARGE = 0x12;
public static final int BILLING_PREMIUM_CREDIT = 0x13;
public static final int BILLING_FREE_CALL = 0x18;
/*
* DPNSS_IE SINGLE BYTE IE
*/
public static final int BUSY_IE = 0xE0; /* Busy IE */
public static final int DIVERSION_BYPASS_IE = 0xE1; /* Diversion bypass IE */
public static final int ENQUIRY_IE = 0xE2; /* Enquiry IE */
public static final int VIRTUALCALL_IE = 0xE3; /* Virtual call IE */
public static final int DIVERSION_VALIDATION_IE = 0xE4; /* Diversion validation IE */
public static final int DPNSS_SIMULATED_ANSWER_IE = 0xE6; /* 627a206 - new DPNSS define */
public static final int DPNSS_EXPLICIT_CALL_TRANSFER_IE = 0xE7; /* 627a206 - new DPNSS define */
/*
* DPNSS_IE MULITIPLE BYTES IE
*/
public static final int DIVERSION_IE = 0x58; /* Diversion IE */
public static final int INTRUDE_IE = 0x59; /* Intrude IE */
public static final int INTRUSION_IE = 0x5A; /* Intrusion IE */
public static final int NSI_IE = 0x5B; /* NSI IE */
public static final int TRANSFER_IE = 0x5C; /* Transfer IE */
public static final int TRANSIT_IE = 0x5D; /* Transit IE */
public static final int EXTENSION_STATUS_IE = 0xE5; /* Extension Status IE */
public static final int TEXT_DISPLAY_IE = 0x5E; /* Text Display IE */
/*
* Diversion Information Element
*/
public static final int DIVERT_IMMEDIATE = 0x01;
public static final int DIVERT_ON_BUSY = 0x02;
public static final int DIVERT_NO_REPLY = 0x03;
public static final int DIVERT_LOCAL = 0x01;
public static final int DIVERT_REMOTE = 0x02;
/*
* Intrusion Information Element
*/
public static final int INTRUDE_PRIOR_VALIDATION = 0x01;
public static final int INTRUDE_NORMAL = 0x02;
public static final int INTRUSION_LEVEL_1 = 0x01;
public static final int INTRUSION_LEVEL_2 = 0x02;
public static final int INTRUSION_LEVEL_3 = 0x03;
/*
* Intrude Information Element
*/
public static final int INTRUDE = 0x01;
public static final int INTRUDE_WITHDRAW = 0x02;
/*
* Transfer Information Element
*/
public static final int TRANSFER_ORIG = 0x01;
public static final int TRANSFER_TERM = 0x02;
/*
* NSI Information Element
*/
public static final int NSI_EEM = 0x01;
public static final int NSI_LLM = 0x02;
/*
* Text Display Information Element
*/
public static final int TEXT_TYPE_NOT_PRESENT = 0x00;
public static final int TEXT_TYPE_NAME = 0x01;
public static final int TEXT_TYPE_MESSAGE = 0x02;
public static final int TEXT_TYPE_REASON = 0x03;
public static final int MAX_DN_SIZE = (16+1);
public static final int MAX_SPID_SIZE = (20+1);
public static final int USER_SIDE = 0; /* User side of ISDN protocol */
public static final int NETWORK_SIDE = 1; /* Network side of ISDN protocol */
public static final int LAYER_2_ONLY = 0; /* ISDN access @ layer 2 */
public static final int FULL_ISDN_STACK = 1; /* ISDN access @ L3 call control */
public static final int AUTO_INIT_TERMINAL = 0; /* Auto Initializing terminal */
public static final int NON_INIT_TERMINAL = 1; /* Non Initilizing Terminal */
public static final int AUTO_TEI_TERMINAL = 0; /* auto TEI assigning Terminal */
public static final int FIXED_TEI_TERMINAL = 1; /* Non-auto TEI assigning term.*/
public static final int TMR_DEFAULT = 0; /* Use default values of timers */
public static final int TMR_DISABLE = -1; /* Do not use the timer */
public static final int USE_DEFAULT_USID_TID = 0; /* Use values by Telnetworks */
public static final int MATCH_USID_AND_TID = 0; /* Match Usid and Tid */
public static final int MATCH_USID_BUT_NOT_TID = 1; /* match usid but tid shouldn't match */
/*
* BIT MASKS FOR D CHANNEL CONFIGURATION FEATURE CONTROL BYTE
*/
public static final int SENDING_COMPLETE_ATTACH = 0x04; /* Add SENDING_COMPLETE IE to
SETUP message */
public static final int HOST_CONTROLLED_RELEASE = 0x10; /* Delay RELEASE reply until host
issues cc_ReleaseCall */
public static final int USER_PERST_L2_ACT = 0x08; /* Persistent L2 activation on
user side */
/* BRI PCM TONE SETTINGS IN FEATURE CONTROL BYTE */
public static final int ULAW_PCM_TONE = 0x01; /* Use Mu-Law for tone */
public static final int ALAW_PCM_TONE = 0x02; /* Use A-Law for tone */
// Variables
private Voice voiceDev = null;
private ISDNLine lineDev = null;
private int linestate = RESET;
private boolean blocked = true;
private String dnisPref = "";
private long crn = 0;
private int ringsSent = 0;
private boolean ringPhase = true;
private String voiceName;
private String dtiName;
public ISDNChannel(String dtiName, String voiceName) {
this (dtiName, voiceName, "");
}
public ISDNChannel(String dtiName, String voiceName, String dnisPreffix) {
super();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -