Dialogic Dialogic Global Call IP IP Phone User Manual


 
Dialogic
®
Global Call IP Technology Guide — November 2007 471
Dialogic Corporation
Note: When using the H.323 protocol, the application may receive a timeout when trying to make an
outbound call if network congestion is encountered and a TCP connection cannot be established. In
this case, the SETUP message is not sent on the network.
8.3.17.6 Code Examples
H.323-Specific Code Example
The following code example shows how to make a call using the H.323 protocol.
/* Make an H323 IP call on line device ldev */
void MakeH323IpCall(LINEDEV ldev)
{
char *IpDisplay = "This is a Display"; /* display data */
char *IpPhoneList= "003227124311"; /* phone list */
char *IpUUI = "This is a UUI"; /* user to user information string */
char *pDestAddrBlk = "127.0.0.1"; /* destination IP address for MAKECALL_BLK*/
char *pSrcAddrBlk = "987654321"; /* origination address for MAKECALL_BLK*/
char *pDestAddrStr = "123456"; /* destination string for gc_MakeCall() function*/
char *IpNSDataData = "This is an NSData data string";
char *IpNSControlData = "This is an NSControl data string";
char *IpCommonObjId = "1 22 333 4444"; /* unique format */
IP_H221NONSTANDARD appH221NonStd;
appH221NonStd.country_code = 181; /* USA */
appH221NonStd.extension = 11;
appH221NonStd.manufacturer_code = 11;
int ChoiceOfNSData = 1;
int ChoiceOfNSControl = 1;
int rc = 0;
CRN crn;
GC_MAKECALL_BLK gcmkbl;
int MakeCallTimeout = 120;
/* initialize GCLIB_MAKECALL_BLK structure */
GCLIB_MAKECALL_BLK gclib_mkbl = {0};
/* set to NULL to retrieve new parameter block from utility function */
GC_PARM_BLK *target_datap = NULL;
gcmkbl.cclib = NULL; /* CCLIB pointer unused */
gcmkbl.gclib = &gclib_mkbl;
/* set GCLIB_ADDRESS_BLK with destination string & type*/
strcpy(gcmkbl.gclib->destination.address,pDestAddrBlk);
gcmkbl.gclib->destination.address_type = GCADDRTYPE_IP;
/* set GCLIB_ADDRESS_BLK with origination string & type*/
strcpy(gcmkbl.gclib->origination.address,pSrcAddrBlk);
gcmkbl.gclib->origination.address_type = GCADDRTYPE_NAT;
/* set signaling PROTOCOL to H323. default is H323 if device is multi-protocol */
rc = gc_util_insert_parm_val(&target_datap,
IPSET_PROTOCOL,
IPPARM_PROTOCOL_BITMASK,
sizeof(char),
IP_PROTOCOL_H323);