HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with the Mid-Layer 429
Mid-layer Management API
registering on file descriptors. After this function is called, other threads will not
be able to set timers or register on file descriptors. Using this function is not
mandatory, but it is useful when you want to synchronize several application
threads.
RvSipMidDestruct()
Frees all Mid-layerMgr resources. After calling this function, the application is
not allowed to register on file descriptors or set timers.
RvSipMidSetLog()
Sets a log handle to the Mid-layer. Use this function if the Mid-layer was
initiated before the SIP Stack. You can use RvSipStackGetLogHandle() to get
the log handle from the SIP Stack.
S
AMPLE CODE The following sample code demonstrates how to initialize, construct, destruct
and terminate the Mid-layer.
/* A global Mid-layer Manager */
RvSipMidMgrHandle g_hMidMgr = NULL;
void InitMid()
{
RvSipMidCfg MidCfg;
/* Initializing the Mid-layer environment */
if (RV_OK != RvSipMidInit())
HandleError();
/* Setting values in the configuration structure */
MidCfg.maxUserFd = 10;
MidCfg.maxUserTimers = 0;
MidCfg.hLog = NULL;
/* Constructing the Mid-layer Manager */
if (RV_OK != RvSipMidConstruct(
sizeof(MidCfg),&MidCfg,&g_hMidMgr)
{