HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
34 HP-UX C SIP Stack Programmer’s Guide
Initialization
Allocates memory.
Initializes timers, the log file and the interface to the network.
To initialize the SIP Stack
1. Declare the RvSipStackCfg structure and the
RvSipStackHandle.
2. Call RvSipStackInitCfg() to fill the configuration structure
with the SIP Stack default values.
3. Set your own configuration values in the configuration
structure.
The remainder of the SIP Stack configuration will be adjusted
according to the changes you have made.
4. Initialize the SIP Stack by calling the RvSipStackConstruct()
function.
Sample Code
The following code demonstrates how to initialize the SIP Stack.
/*==================================================================================*/
RvSipStackCfg stackCfg;
RvSipStackHandle hStack;
RvStatus AppInitSipStack()
{
RvStatus rv;
RvSipStackInitCfg(sizeof(stackCfg), &stackCfg));
stackCfg.maxCallLegs = 5;
stackCfg.maxTransactions = 15;
rv = RvSipStackConstruct(sizeof(stackCfg), &stackCfg, &hStack);
if(rv != RV_OK)
{
printf("Failed to initialize the Stack");
}
return rv;
}
/*==================================================================================*/
In the above code, the maxCallLegs and maxTransactions settings limit the
SIP Stack to creating a maximum of 5 calls and 15 transactions simultaneously.