Dialogic Dialogic Global Call IP IP Phone User Manual


 
Dialogic
®
Global Call IP Technology Guide — November 2007 185
Dialogic Corporation
IP-Specific Operations
#include "gclib.h"
..
..
GC_PARM_BLK *pParmBlock = NULL;
char *pDestAddrBlk = "1111@127.0.0.1\0";
char *pReqURI = "sip:2222@127.0.0.1\0";
/* Insert SIP Request-URI */
/* Add 1 to strlen for the NULL termination character */
gc_util_insert_parm_ref_ex(&pParmBlock,
IPSET_SIP_MSGINFO,
IPPARM_REQUEST_URI,
(unsigned long) (strlen(pReqURI) + 1),
pReqURI);
/* Set Call Information */
gc_SetUserInfo(GCTGT_GCLIB_CHAN, ldev, pParmBlock, GC_SINGLECALL);
gc_util_delete_parm_blk(pParmBlock);
/* set GCLIB_ADDRESS_BLK with destination string & type*/
strcpy(gcmkbl.gclib->destination.address,pDestAddrBlk);
gcmkbl.gclib->destination.address_type = GCADDRTYPE_TRANSPARENT;
/* calling the function with the MAKECALL_BLK,
the INVITE "To" field will be: 1111@127.0.0.1
the INVITE RequestURI will be: sip:2222@127.0.0.1
*/
gc_MakeCall(ldev, &crn, NULL, &gcmkbl, MakeCallTimeout, EV_ASYNC);
The following code snippet illustrates how an application can set a proprietary header called
Remote-Party-ID. This header is a CableLabs (DCS Group) sponsored extension to transmit
trusted Caller Identity and Privacy ISUP indications which have not been standardized for
translation across SIP networks.
GC_PARM_BLKP parmblkp = NULL;
char *pRemotePartyIdHeader = "Remote-Party-ID:Alice";
gc_util_insert_parm_ref_ex(&parmblkp,
IPSET_SIP_MSGINFO,
IPPARM_SIP_HDR,
(unsigned long) (strlen(pRemotePartyIdHeader) + 1),
pRemotePartyIdHeader);
gc_SetUserInfo(GCTGT_GCLIB_CRN, crn, parmblkp, GC_SINGLECALL);
gc_util_delete_parm_blk(parmblkp);
// transmit SIP message to network
...
...
4.9.6 Retrieving SIP Message Header Fields
The reception of most SIP requests and replies is reported to the application by means of a Global
Call event, with information about the type of message contained in the metaevent data. If SIP
message information access was enabled when the virtual board was started (see Section 4.9.2,
“Enabling Access to SIP Header Information”, on page 179), the metaevent will also contain
information from SIP header fields. The application processes the Dialogic
®
Global Call API event
using the gc_GetMetaEvent( ) function, and then processes the GC_PARM_BLK using Global