Dialogic Dialogic Global Call IP IP Phone User Manual


 
434 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
gc_util_insert_parm_ref_ex( ) — insert a GC_PARM_BLK parameter by reference
Cautions
To avoid a memory leak, any GC_PARM_BLK created must be deleted using the
gc_util_delete_parm_blk(
) function.
Insertion of data that exceeds 255 bytes in length is only supported for specific setID/parmID
pairs. Refer to the appropriate Global Call Technology Guide for information on maximum
data length for each setID/parmID pair.
Errors
If this function returns GC_ERROR to indicate failure, use the gc_ErrorInfo( ) function to
retrieve the reason for the error. See the “Error Handling” section in the Dialogic
®
Global Call
API Programming Guide. All Global Call error codes are defined in the gcerr.h file.
Attempting to insert data greater than 255 bytes in length using a setID/parmID pair that does
not support extended-length data produces an error indication. In this situation, the
gc_ErrorInfo(
) function returns the value EGC_INVPARM.
Example
#include "gclib.h"
#include "gcip.h"
void SetHeader(void)
{
GC_PARM_BLKP my_blkp = NULL;
char* pChar = "Remote-Party_ID: This string can be greater than 255 bytes";
/* Add 1 to strlen for null termination */
unsigned long data_size = strlen(pChar) + 1;
/* insert parm and associated data into the GC_PARM_BLK */
if ( gc_util_insert_parm_ref_ex( &my_blkp, IPSET_SIP_MSGINFO, IPPARM_SIP_HDR, data_size,
(void*)( pChar )) != GC_SUCCESS )
{
/* Process error */
}
/* At this point the application can overwrite the data pointed to by pChar. */
pChar = NULL;
Parameter Description
parm_blkpp points to the address of a valid GC_PARM_BLK where the parameter
element is to be inserted. Set
*parm_blkpp to NULL to insert the
parameter into a new block.
setID set ID of the parameter to be inserted
parmID parameter ID of the parameter to be inserted
data_size size, in bytes, of the value data associated with this parameter. For certain
set ID/parm ID pairs the maximum size is configurable at library start-up
using IPCCLIB_START_DATA.max_parm_data_size; for all other
parameters, the maximum size is 255 bytes.
datap points to the value data associated with this parameter