HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
142 HP-UX C SIP Stack Programmer’s Guide
Registering Application Callbacks
Sample Code
/*===================================================================================*/
/*Implements the register-client state changed event handler. Prints the handle of each
successfully registered register-client and terminates it.*/
void AppRegClientStateChangedEvHandler (
IN RvSipRegClientHandle hRegClient,
IN RvSipAppRegClientHandle hAppRegClient,
IN RvSipRegClientState eNewState,
IN RvSipRegClientStateChangeReason eReason)
{
if (eNewState == RVSIP_REG_CLIENT_STATE_REGISTERED)
{
printf("Register-Client %x was successfully
registered\n", hRegClient);
RvSipRegClientTerminate(hRegClient);
}
}
/*===================================================================================*/
The following steps describe how to register your application callbacks:
To register application callbacks
1. Declare a RvSipRegClientEvHandlers structure.
2. Initialize all the structure members to zero using memset().
3. Set the application defined callbacks to the
RvSipRegClientEvHandlers structure.
4. Call RvSipRegClientMgrSetEvHandlers() with the initialized
structure.
Sample Code
The following code demonstrates an implementation of application callback
registration.