3.1.14. gc_MakeCall( )
Call parameters (see Table 2) can be specified when using the gc_MakeCall( ) function. The parameters values specified are only valid for the duration of the current call. At the end of the current call, the default parameter values for the specific line device override these parameter values.
The makecallp parameter of the gc_MakeCall( ) function is a pointer to the GC_MAKECALL_BLK structure. The GC_MAKECALL_BLK structure has a gclib field that points to a GCLIB_MAKECALL_BLK structure. The gclib.ext_datap field in turn points to a GC_PARM_BLK structure with a list of the parameters to be set as call values. Table 2 describes the parameters that can be accessed through the gclib.ext_datap pointer.
GCSET_CHAN_CAPABILITY
- IPPARM_LOCAL_CAPABILITY
Datatype: IP_CAPABILITY. See Section 7.2, "IP_CAPABILITY" for more information.IPSET_CALLINFO
See Section 6.2, "IPSET_CALLINFO Parameter Set" for more information.IPSET_NONSTANDARDDATA
See Section 6.6, "IPSET_NONSTANDARDDATA Parameter Set" for more information.There are two options for setting the destination address when using the gc_MakeCall( ) function:
- The destination address can be specified in the numberstr parameter of the gc_MakeCall( ) function. The value of the numberstr parameter must indicate a type using one of the following prefixes:
- For example, a valid numberstr value is "TA:127.0.0.1". See Chapter 9, "Called and Calling Party Address List Format" for more information.
If the destination address is specified in the numberstr parameter, the destination address should not be specified in the GCLIB_MAKECALL_BLK structure. Other fields in the GC_MAKECALL_BLK structure can still be used, for example, coder information.- The destination address can be specified in the destination.address field in the GCLIB_MAKECALL_BLK structure. The prefixes, TA:, TEL:, or NAME: should not be used in this case. The destination.address_type field defines the type (IP address, name, telephone number) in the destination.address field.
For example, if the destination.address field is "127.0.0.1", the destination.address_type field must be GCADDRTYPE_IP. Other supported address types are:
- GCADDRTYPE_INTL - International telephone number
- GCADDRTYPE_NAT - National telephone number
- GCADDRTYPE_LOCAL - Local telephone number
- GCADDRTYPE_DOMAIN - Domain name
- GCADDRTYPE_URL - URL name
- GCADDRTYPE_EMAIL - email address
- In this case, any address specified in the numberstr parameter of the gc_MakeCall( ) function is ignored.
- Note: When both methods above are used to specify the destination address, the address in the GCLIB_MAKECALL_BLK structure takes precedence.
In asynchronous mode, if the timeout parameter is set to 0, a call can be disconnected if either the underlying stack times out waiting for a response from the peer or, if the peer decides to reject the call. There are three timer parameters in the H.323 stack configuration file, config.val, that can be used to configure the stack timeout behavior:
- Q931\responseTimeOut: Maximum time in seconds to wait for the first response to a new call. If no response is received during this time, the Disconnect procedure is initiated. The default value is 50 sec.
- Q931\connectTimeOut: Maximum time in seconds to wait for the establishment of a new call, after receiving the first response to the call. If the call is not established during this time, the Disconnect procedure is initiated. The default value is 500 sec.
- h245\timeout: The maximum time in seconds to wait for the called party to acknowledge receipt of the capabilities it sent. The default value is 40 sec.
See the DM3 IPLink User's Guide for Windows for more information about the syntax of the config.val file.
The following code example shows how to:
- Create a GC_PARM_BLK with information on four supported coders, display information, a phone list and user-to-user information.
- Use the GC_PARM_BLK in a gc_MakeCall( ) function.
- Note: When using gc_MakeCall( ) to set coder capabilities, only the coder capabilities in the transmit direction (IP_CAP_DIR_LCLTRANSMIT) can be specified. The function fails if attempting to specify the coder capabilities in the receive direction (IP_CAP_DIR_LCLRECEIVE).
/* Make an IP call on line device ldev */ void MakeIpCall(LINEDEV ldev) { char * IpDisplay = "This is a Display"; /* display data */ char * IpPhoneList= "003227124311"; /* phone list */ char * IpDisplay = "This is a UUI"; /* user to user information string */ char *paddr = "TA:127.0.0.1"; /* destination IP address */ int rc = 0; const int MakeCallTimeout = 30; CRN crn; GC_MAKECALL_BLK gcmkbl; /* 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; /* initialize IP_CAPABILITY structure */ IP_CAPABILITY t_Capability = {0}; /* configure a GC_PARM_BLK with four coders, display, phone list and UUI message: */ /* specify and insert first capability parameter data for G.7231 coder */ t_Capability.type = GCCAPTYPE_AUDIO; t_Capability.direction = IP_CAP_DIR_LCLTRANSMIT; t_Capability.extra.audio.VAD = GCPV_DISABLE; t_Capability.extra.audio.frames_per_pkt = 1; t_Capability.capability = GCCAP_AUDIO_g7231_6_3k; rc = gc_util_insert_parm_ref(&target_datap, GCSET_CHAN_CAPABILITY, IPPARM_LOCAL_CAPABILITY, sizeof(IP_CAPABILITY), &t_Capability); /* specify and insert second capability parameter data for G.7229AnnexA coder */ /* changing only frames per pkt and the coder type from first capability: */ t_Capability.extra.audio.frames_per_pkt = 3; t_Capability.capability = GCCAP_AUDIO_g729AnnexA; rc = gc_util_insert_parm_ref(&target_datap, GCSET_CHAN_CAPABILITY, IPPARM_LOCAL_CAPABILITY, sizeof(IP_CAPABILITY), &t_Capability); /* specify and insert 3rd capability parameter data for G.711Alaw 64kbit coder */ /* changing only frames per pkt and the coder type from first capability: */ t_Capability.capability = GCCAP_AUDIO_g711Alaw64k; t_Capability.extra.audio.frames_per_pkt = 10; /* For G.711 use frame size (ms) here, frames per packet fixed at 1 fpp */ rc = gc_util_insert_parm_ref(&target_datap, GCSET_CHAN_CAPABILITY, IPPARM_LOCAL_CAPABILITY, sizeof(IP_CAPABILITY), &t_Capability); /* specify and insert fourth capability parameter data for G.711 Ulaw 64kbit coder */ /* changing only the coder type from previous capability */ t_Capability.capability = GCCAP_AUDIO_g711Ulaw64k; rc = gc_util_insert_parm_ref(&target_datap, GCSET_CHAN_CAPABILITY, IPPARM_LOCAL_CAPABILITY, sizeof(IP_CAPABILITY), &t_Capability); /* insert display string */ rc = gc_util_insert_parm_ref(&target_datap, IPSET_CALLINFO, IPPARM_DISPLAY, strlen(IpDisplay)+1, IpDisplay); /* insert phone list */ rc = gc_util_insert_parm_ref(&target_datap, IPSET_CALLINFO, IPPARM_PHONELIST, strlen(IpPhoneList)+1, IpPhoneList); /* insert user to user information */ rc = gc_util_insert_parm_ref(&target_datap, IPSET_CALLINFO, IPPARM_USERUSER_INFO, strlen(IpUUI)+1, IpUUI); if (rc == 0) { gclib_mkbl.ext_datap = target_datap; retcode = gc_MakeCall(ldev, &crn, paddr, &gcmkbl, MakeCallTimeout, EV_ASYNC); /* deallocate GC_PARM_BLK pointer */ gc_util_delete_parm(target_datap); } }
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation