HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

428 HP-UX C SIP Stack Programmers Guide
Mid-layer Management API
MID-LAYER MANAGER
H
ANDLE
The Mid-layerMgr is identified by using the RvSipMidMgrHandle handle.
INITIALIZING,
C
ONSTRUCTING AND
D
ESTRUCTING OF THE
M
ID-LAYER
The Mid-layer should be initialized before using any of the Mid-layer functions.
Initialization of the Mid-layer sets the environment for Mid-layer operations.
After initializing the Mid-layer, you should construct the Mid-layerMgr. The
Mid-layerMgr is needed for operations such as setting timers and registering on
file descriptors.
The following API functions are used for initializing, constructing and
destructing the Mid-layer.
RvSipMidInit()
Starts the global environment for the Mid-layer. Use this function before calling
any other function from the Mid-layer.
You can construct, destruct and work with Mid-layer API as long as one of the
SIP Stacks is running. If, however, you want to work with the Mid-layer while
no Stack is initiated—or you wish to work with more than one Stack—you need
to call RvSipMidInit() to initialize the global environment of SIP. When the
Mid-layer API will no longer be called, you need to call RvSipMidEnd().
RvSipMidEnd()
Stops the global environment for the Mid-layer. You have to call this function
when you are done working with the Mid-layer to free resources.
RvSipMidConstruct()
Constructs the Mid-layer and provides you with a Mid-layerMgr handle. When
calling the RvSipMidConstruct() function, you have to supply a configuration
structure of the RvSipMidCfg type with the following information:
The maximum number of file descriptors you want to be
registered on concurrently.
The maximum number of timers that you want to set
concurrently.
A log handle (optional)
RvSipMidPrepareDestruct()
When you have finished working with the Mid-layer and before calling the
RvSipMidDestruct() function, you can call the RvSipMidPrepareDestruct()
function. This function disables the functionality of setting timers and