Dialogic 05-0867-005 Table Top Game User Manual


 
Appendix A - Call Control Scenarios
405
The following code samples demonstrate the use of the Dialogic API at various
stages of the TBCT call scenario.
1. Opening a board level device:
LINEDEV dti_dev1_hdl;
.
.
rc = cc_Open( &dti_bd_hdl, "dtiB1", 0);
.
.
2. Retrieving the Network’s Call Reference Value:
CRN crn1=0;
unsigned short crn1_crv=0;
.
.
rc = cc_GetNetCRV ( crn1, &crn1_crv );
.
.
3. Building and sending the Facility message to initiate the TBCT for ISDN NI2
protocols on a DMS switch:
typedef union {
struct {
unsigned char ie_id; // Byte 1
unsigned char length; // Byte 2
unsigned char prot_profile :5; // Byte 3, Intel Layout
unsigned char spare :2;
unsigned char extension_1 :1;
unsigned char comp_type; // Byte 4
unsigned char comp_length; // Byte 5
unsigned char comp_data[249]; // Bytes 6 to 254
.
.
// Preparing the Facility IE Element
tbct_ie.bits.ie_id = 0x1C;
tbct_ie.bits.length = 21;
tbct_ie.bits.extension_1 = 1;
tbct_ie.bits.spare = 0x00;
tbct_ie.bits.prot_profile = 0x11; // Supplementary Service (ROSE)
tbct_ie.bits.comp_type = 0xA1; // Invoke
tbct_ie.bits.comp_length = 18; // Component Length (Data Only)
tbct_ie.bits.comp_data[0] = 0x02; // Invoke Identifier, tag
tbct_ie.bits.comp_data[1] = 0x01; // Invoke Identifier, length
tbct_ie.bits.comp_data[2] = 0x2E; // Invoke Identifier, invoke ie (varies)