AG ISDN uses data structures to configure the ISDN protocol stack, send messages to the protocol stack, and receive messages from the protocol stack. This chapter presents the AG ISDN data structures in detail.
These data structures are defined in the isdnparm.h header file.
The following section describes the structures used to convey messages and message data between the ISDN protocol stack and the application: ISDN_MESSAGE and ISDN_PACKET.
For more information on sending and receiving AG ISDN messages, see Chapter 3.
A pointer to the ISDN_MESSAGE structure is passed to isdnSendMessage in the message argument. In this structure, the application specifies the NAI and the connection id of the call that the message concerns. Also specified is the message to be sent, expressed using one of the message primitives documented in Chapter 8. (The message primitive appears in the code field in this structure.)
When the ISDN_PACKET structure is received by the application, it contains a pointer to an ISDN_MESSAGE structure containing message data. For more information, see Section 6.2.2.
ISDN_MESSAGE is defined as follows:
typedef struct ISDN_MESSAGE
{
nai_t nai; /* Network access interface index */
ent_id_t from_ent; /* Message source */
ent_id_t to_ent; /* Message destination */
sapi_t to_sapi; /* Destination Service Access Point */
union {
add_t conn_id; /* Connection identifier for the ACU layer */
add_t crv; /* Call Reference value for NS layer */
add_t ces; /* Connection Endpoint suffix (DL layer upper half) */
add_t tei; /* Terminal Endpoint identifier (DL layer lower half) */
add_t chani; /* Physical layer channel identifier */
} add;
code_t code; /* Primitive code unique only between two entities */
WORD inf0; /* Information location 0, not used */
WORD inf1; /* Information location 1, not used */
WORD inf2; /* Information location 2, not used */
WORD inf3; /* Information location 3, not used */
WORD inf4; /* Information location 4, not used */
WORD data_size; /* Size of data to follow */
BYTE data_offset; /* Use for LAPD data hole */
BYTE pad[1]; /* 32 bit alignment */
DWORD userid;
} ISDN_MESSAGE;
When a message is sent from the protocol stack to the application, it is sent in an ISDN_PACKET structure. ISDN_PACKET contains an ISDN_MESSAGE structure (containing the message), and a data area containing the ACU message header. A pointer to the ISDN_PACKET structure is included in the CTA_EVENT structure returned by ctaWaitEvent (or the ADI_EVENT structure returned by adiFetchAndProcess).
For more information about receiving ISDN messages, see Section 3.6.
ISDN_PACKET is defined as follows:
typedef struct ISDN_PACKET
{
ISDN_MESSAGE message; /* ISDN message identification information */
BYTE data[4]; /* Data included in packet (>=0) */
} ISDN_PACKET;
This section lists the data structures passed to isdnStartProtocol. The parms argument points to one of these parameter structures, depending upon the configuration the ISDN protocol stack is to run in:
|
For... |
Specify... |
|
ACU configuration |
|
|
LAPD configuration |
|
|
NCC configuration |
Each of these structures includes the CONFIG_DL_SAPI structure, described in Section 6.4.
Refer to Chapter 8 for more information on the default values of these parameters.
This data structure configures the protocol stack for Q.931 call control. A pointer to this structure is passed as an argument to isdnStartProtocol. Refer to Appendix C: Parameters for more information on the default values of the parameters in this structure.
For more information on the CONFIG_DL_SAPI structure referenced in this structure, see Section 6.4.
The structure is defined as follows:
typedef struct ISDN_PROTOCOL_PARMS_Q931CC
{
DWORD size; /* Size of the structure */
WORD hdlc_channel; /* HDLC channel index */
WORD rate; /* Data rate: ISDN_RATE_56K or ISDN_RATE_64K*/
WORD pad;
CONFIG_DL_SAPI sapi_sig; /* Data link signaling layer configuration */
CONFIG_DL_SAPI sapi_x25; /* Not supported */
CONFIG_DL_SAPI sapi_mdl; /* Data link management component config */
CONFIG_DL_SAPI other[2]; /* Not supported */
union
{ /* These structures contain sets of values */
timer_val_t at5[AT5_T_LAST]; /* for ISDN timers. The actual set used de-*/
timer_val_t at9[AT9_T_LAST]; /* pends upon the country variant specified*/
timer_val_t dms[DMS_T_LAST]; /* with the `country' argument in the */
timer_val_t ni1[NI1_T_LAST]; /* isdnStartProtocol call. The structures */
timer_val_t ni2[NI2_T_LAST]; /* should be set to 0 in order to use the */
timer_val_t au1[AU1_T_LAST]; /* built-in defaults defined by the network*/
timer_val_t hkt[HKT_T_LAST]; /* signaling layer of the ISDN protocol */
timer_val_t ntt[NTT_T_LAST]; /* stack. */
timer_val_t bt2[BT2_T_LAST]; /* */
timer_val_t bv1[BV1_T_LAST]; /* CAUTION: The values of these timers may */
timer_val_t ets[ETS_T_LAST]; /* be controlled by local regula- */
timer_val_t qsi[QSI_T_LAST]; /* tory authorities: changing */
timer_val_t swd[SWD_T_LAST]; /* these values may invalidate */
timer_val_t tr6[TR6_T_LAST]; /* regulatory approvals. Check */
timer_val_t vn2[VN2_T_LAST]; /* with the local authority for */
timer_val_t vn3[VN3_T_LAST]; /* more specific information on */
timer_val_t vn6[VN6_T_LAST]; /* any limitations. */
} timers;
WORD t309; /* T309 in use flag indicates if data link */
WORD wpad; /* release and establish timers are in */
/* effect. */
/*
** Available services
*/
BYTE services_list[CC_MX_SERVICES+1]; /* Set of ACU services required by*/
/* protocol stack */
/*
** Framing timers
*/
WORD max_FEC_errors; /* Max number of framing errors allowed */
/* during the interval T198 */
timer_val_t t101; /* ms of bad framing before disabling sending*/
/* D channel packets */
timer_val_t t102; /* ms of good framing before enabling sending*/
/* D channel packets */
timer_val_t t198; /* Integration period for framing errors */
/*
** When to assign/remove a TEI
*/
WORD tei_time_assignment; /* TEI time assignment at: CONFIGURATION, */
/* NA ACTIVATION or USAGE time (isdndl.h) */
WORD tei_time_removal; /* TEI time removal at: NA DEACTIVATION, */
/* POWER DOWN (dlint.h) */
BYTE tei[3]; /* tei values: */
/* 0 broadcast */
/* 1-63 Non automatic TEI assignment */
/* 127 Automatic TEI assignment */
BYTE digitstoroute; /* Number of digits needed to route when */
/* using overlap receiving */
/*
** Call control behavior
*/
WORD in_calls_behavior; /* Bits describing incoming calls behavior */
WORD out_calls_behavior; /* Bits describing outgoing calls behavior */
} ISDN_PROTOCOL_PARMS_Q931CC;
This data structure configures the protocol stack for LAPD. A pointer to this structure is passed as an argument to isdnStartProtocol. Refer to Appendix C: Parameters for more information on the default values of the parameters in this structure.
For more information on the CONFIG_DL_SAPI structure referenced in this structure, see Section 6.4.
The structure is defined as follows:
typedef struct ISDN_PROTOCOL_PARMS_LAPD
{
DWORD size; /* Size of the structure */
WORD pad;
WORD hdlc_channel; /* HDLC channel index */
WORD rate; /* Data rate: ISDN_RATE_56K or ISDN_RATE_64K*/
WORD pad1;
CONFIG_DL_SAPI sapi_sig; /* Data link signaling layer configuration */
CONFIG_DL_SAPI sapi_x25; /* Not supported */
CONFIG_DL_SAPI sapi_mdl; /* Data link management component config */
CONFIG_DL_SAPI other[2]; /* Not supported */
BYTE pad2[2];
/*
** Framing timers
*/
WORD max_FEC_errors; /* Max number of framing errors allowed */
/* during the interval T198 */
timer_val_t t101; /* ms of bad framing before disabling sending*/
/* D channel packets */
timer_val_t t102; /* ms of good framing before enabling sending*/
/* D channel packets */
timer_val_t t198; /* Integration period for framing errors */
/*
** When to assign/remove a TEI
*/
WORD tei_time_assignment; /* TEI time assignment at: CONFIGURATION, */
/* NA ACTIVATION or USAGE time (isdndl.h) */
WORD tei_time_removal; /* TEI time removal at: NA DEACTIVATION, */
/* POWER DOWN (isdndl.h) */
BYTE tei[3]; /* tei values: */
/* 0 broadcast */
/* 1-63 Non automatic TEI assignment */
/* 127 Automatic TEI assignment */
BYTE digitstoroute; /* Number of digits needed to route when */
/* using overlap receiving */
BYTE bpad;
} ISDN_PROTOCOL_PARMS_LAPD;
This data structure configures the protocol stack so it is accessible to the standard AG Access or CT Access Natural Call Control API. A pointer to this structure is passed as an argument to isdnStartProtocol. The structure is identical to the ISDN_PROTOCOL_PARMS_Q931CC structure.
The CONFIG_DL_SAPI data structure describes the configuration of the data link SAP. CONFIG_DL_SAPI is included in the ISDN_PROTOCOL_ PARMS_Q931CC, ISDN_PROTOCOL_PARMS_LAPD, and ISDN_PROTOCOL_PARMS_CHANNELIZED data structures.
CONFIG_DL_SAPI is included four times in each of these structures. Two of these four must be enabled:
Refer to Appendix C: Parameters for more details on these components and the default values.
CONFIG_DL_SAPI is defined as follows:
typedef struct CONFIG_DL_SAPI
{
WORD enabled; /* SAPI enabled */
WORD override_defaults; /* Override default SAPI configuration */
/* Note that setting enabled to 1 and */
/* override_defaults to 0 causes the ISDN*/
/* protocol stack to set all remaining */
/* fields to default values. */
sapi_t sapi; /* SAPI identifier */
BYTE modulo; /* modulo 8 or 128 */
BYTE k; /* Window size */
BYTE n_cep; /* No. of connection endpoints for sapi */
union
{
timer_val_t t200; /* Time to wait for an ack to a frame */
/* before initiating recovery (DL) */
timer_val_t t201; /* Minimum time between TEI identity */
} dl_timer_1; /* check messages (MDL) */
union
{
timer_val_t t202; /* Minimum time between TEI identity */
/* request (MDL) */
timer_val_t t203; /* Maximum time with no frames exchanged.*/
/* (DL watchdog timer) */
} dl_timer_2;
union
{
BYTE n200; /* max. number of re-transmissions of a */
/* frame (SAPI_SIG) */
BYTE n202; /* max. number of retransmissions of TEI */
/* identity message (SAPI_MDL) */
} n_retries;
BYTE pad;
WORD n201; /* I frame maximum size (N201) */
BYTE xid_max_val; /* XID retransmission max value */
BYTE lapf_add_format; /* LAP F address format */
BYTE lapf_discard; /* LAP F discard eligibility */
BYTE lapf_dc; /* DLCI or DL-CORE */
timer_val_t xid_timer; /* XID retransmission timer value */
timer_val_t reserved;
} CONFIG_DL_SAPI;
Natural MicroSystems, Inc.
100 Crossing Boulevard
Framingham, MA 01702