5.3. GC_MAKECALL_BLK
The GC_MAKECALL_BLK structure contains information used by the gc_MakeCall( ) function when setting up a call. The structure is defined as follows:
typedef struct { GCLIB_MAKECALL_BLK *gclib; void *cclib; } GC_MAKECALL_BLK, *GC_MAKECALL_BLKP;The gclib pointer points to information used by the gc_MakeCall( ) function that is common across technologies. The GCLIB_MAKECALL_BLK structure supports generic call related parameters. The following GCLIB_MAKECALL_BLK structure shows the fields that are common across most protocols. In cases where a protocol does not require changing any one of the fields, a default value will be assigned.
typedef struct { GCLIB_ADDRESS_BLK destination; /* Called party information */ GCLIB_ADDRESS_BLK origination; /* Calling party information*/ GCLIB_CHAN_BLKP chan_info; /* Pointer to channel information */ GCLIB_CALL_BLK call_info; /* Call information */ GC_PARM_BLK ext_datap; /* Pointer to extended parameters */ } GCLIB_MAKECALL_BLK, *GCLIB_MAKECALL_BLKP;For description of the fields in the GCLIB_MAKECALL_BLK structure, refer to the Global Call API Library Reference.
There are certain parameters, which are defined for ISDN only. These parameters can be defined in the ext_datap GC_PARM_BLK. Table 38 list the parameters that can be included.
When using Springware boards, a sample MAKECALL_BLK initialization is shown below:
#include "gclib.h" #include "gcerr.h" #include "gcisdn.h" void makecall(LINEDEV linedev) { CRN crn; int cclibid; /* cclib id for gc_ErrorValue() */ int gc_error; /* Global Call error code */ long cc_error; /* Call Control Library error code */ char *msg; /* points to the error message string */ int timeout = 30; char dnis[] = "6343703"; GC_PARM_BLKP t_pParmBlk=NULL; GC_MAKECALL_BLK gc_makecall; gc_util_insert_parm_val(&t_pParmBlk, GCSET_CHAN_CAPABILITY, \ GCPARM_TYPE, sizeof(unsigned char), GCCAPTYPE_AUDIO); gc_util_insert_parm_val(&t_pParmBlk, GCSET_CHAN_CAPABILITY, \ GCPARM_CAPABILITY, sizeof(unsigned char), 0xFF); gc_util_insert_parm_val(&t_pParmBlk, GCSET_CHAN_CAPABILITY, \ GCPARM_RATE, sizeof(unsigned char), 0xFF); gc_util_insert_parm_val(&t_pParmBlk, GCIS_SET_BEARER_CHNL, \ GCIS_PARM_TRANSFER_MODE, sizeof(unsigned char), ISDN_ITM_CIRCUIT); gc_util_insert_parm_val(&t_pParmBlk, GCIS_SET_BEARER_CHNL, \ GCIS_PARM_TRANSFER_RATE, sizeof(unsigned char), BEAR_RATE_64KBPS); gc_util_insert_parm_val(&t_pParmBlk, GCIS_SET_FACILITY, \ GCIS_PARM_FACILITY_FEATURESERVICE, sizeof(unsigned char), ISDN_SERVICE); gc_util_insert_parm_val(&t_pParmBlk, GCIS_SET_FACILITY, \ GCIS_PARM_FACILITY_CODINGVALUE, sizeof(unsigned char), ISDN_MEGACOM); if ((gc_makecall.gclib = (GCLIB_MAKECALL_BLKP)malloc(sizeof(GCLIB_MAKECALL_BLK)+ t_pParmBlk->parm_data_size))==NULL) { /* print_error("could not malloc GCLIB_MAKECALL_BLK!\n"); */ exit(1); } gc_makecall.gclib->ext_data.parm_data_size = t_pParmBlk->parm_data_size; memcpy(gc_makecall.gclib->ext_data.parm_data_buf, t_pParmBlk->parm_data_buf, \ t_pParmBlk->parm_data_size); gc_makecall.cclib = NULL; gc_util_delete_parm_blk(t_pParmBlk); gc_makecall.gclib->destination.address_type = GCADDRTYPE_NAT; gc_makecall.gclib->destination.address_plan = GCADDRPLAN_ISDN; gc_makecall.gclib->destination.sub_address_type = GCSUBADDR_USER; gc_makecall.gclib->destination.sub_address_plan = 0; strcpy(gc_makecall.gclib->destination.sub_address, "456"); gc_makecall.gclib->origination.address_type = GCADDRTYPE_NAT; gc_makecall.gclib->origination.address_plan = GCADDRPLAN_ISDN; gc_makecall.gclib->origination.sub_address_type = GCSUBADDR_USER; gc_makecall.gclib->origination.sub_address_plan = 0; strcpy(gc_makecall.gclib->origination.address, "6346666"); strcpy(gc_makecall.gclib->origination.sub_address, "456"); gc_makecall.gclib->call_info.address_info = GCADDRINFO_ENBLOC; if(gc_MakeCall(linedev, &crn, dnis, &gc_makecall, timeout, \ EV_ASYNC) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorValue( &gc_error, &cclibid, &cc_error); gc_ResultMsg( LIBID_GC, (long) gc_error, &msg); } }
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation