HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
60 HP-UX C SIP Stack Programmer’s Guide
Call-Leg Manager API
According to the prototypes, you can implement any callbacks you find
necessary. All callback functions are gathered together in a structure called
RvSipCallLegEvHandlers. This structure is where you should set your callback
function pointers and is given as a parameter to
RvSipCallLegMgrSetEvHandlers(). The call-leg notifies of an event using the
callback functions you implemented.
If you are not interested in certain events, enter a zero value in
RvSipCallLegEvHandlers for callback functions which manage those events.
The call-leg will not notify you when these events occur.
Although you can set the event handlers at any time, it is customary to set them
immediately after RvSipStackConstruct() so that the application receives all
necessary notifications immediately.
REGISTERING
A
PPLICATION
CALLBACKS
To register an application callback, you must first define the callback according
to the prototype. The following sample code demonstrates the implementation
of two callback functions.
Sample Code
/*===================================================================================*/
/*Implements the call-leg created event handler. Prints the handle of the new
incoming call-leg.*/
void RVCALLCONV AppCallLegCreatedEvHandler(
IN RvSipCallLegHandle hCallLeg,
OUT RvSipAppCallLegHandle *phAppCallLeg)
{
printf("Incoming call-leg %x was created\n",hCallLeg);
}
/*===================================================================================*/
Sample Code
/*===================================================================================*/
/*Implements the call-leg state change event handler. Accepts all incoming calls.*/
void RVCALLCONV AppCallLegStateChangedEvHandler(
IN RvSipCallLegHandle hCallLeg,
IN RvSipAppCallLegHandle hAppCallLeg,
IN RvSipCallLegState eState,
IN RvSipCallLegStateChangeReason eReason)
{