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

Working with Register-Clients 143
Exchanging Handles with the Application
/*===================================================================================*/
void SetRegisterClientEvHandlers(
RvSipRegClientMgrHandle hMgr)
{
/*Step 1*/
RvSipRegClientEvHandlers appEvHandlers;
/*Step 2*/
memset(&appEvHandlers, 0,
sizeof(RvSipRegClientEvHandlers));
/*Step 3*/
appEvHandlers.RvSipRegClientStateChangedEv = AppRegClientStateChangedEvHandler;
/*Step 4*/
RvSipRegClientMgrSetEvHandlers
(hMgr,
&appEvHandlers,
sizeof(appEvHandlers));
}
/*===================================================================================*/
EXCHANGING
HANDLES WITH THE
A
PPLICATION
The SIP Stack enables you to create your own handle to a register-client. This
will prove useful when you have your own application register-client database.
You can give your handle to the SIP Stack when calling
RvSipRegClientMgrCreateRegClient() which it will then supply when calling
your application callbacks.
GLOBAL CALL-ID The Register-ClientMgr is responsible for generating the Call-ID once and
supplying it to all non-stand-alone register-clients. This Call-ID value can be set
to the Register-ClientMgr. If you choose to set a different Call-ID header value
to the manager—instead of using the generated Call-ID header value—you must
do it only once, immediately after the SIP Stack is constructed. The ability to set
the Call-ID allows a client to use the same Call-ID header value within more
than one reboot cycle.
INITIATING A
R
EGISTER-CLIENT
The following steps describe a simple way to register to a registrar using the
Register-Client API. The following code is an example of the implementation of
these steps.