HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
62 HP-UX C SIP Stack Programmer’s Guide
Initiating a Call
/*==================================================================================*/
EXCHANGING H ANDLES
WITH THE APPLICATION
The SIP Stack enables you to create your own handle to a call-leg. This will
prove useful when you have your own application call-leg database. You can
provide the SIP Stack with your call-leg handle, which it must supply when
calling your application callbacks. You can use
RvSipCallLegMgrCreateCallLeg() to exchange handles for outgoing calls and
RvSipCallLegCreatedEv() to exchange handles for incoming calls. You can
change your application handle at any time with the
RvSipCallLegSetAppHandle() function.
INITIATING A CALL The following steps describe how to initiate a call:
To initiate a call
1. Declare a handle for the new call-leg.
2. Call the RvSipCallLegMgrCreateCallLeg() function. This
enables you to exchange handles with the SIP Stack.
3. Call the RvSipCallLegMake() function. This function sends an
INVITE request to the remote party.
Sample Code
The following code demonstrates an implementation of the call invitation
procedure.
/*==================================================================================*/
void AppConnectCall(IN RvSipCallLegMgrHandle hCallLegMgr)
{
RvSipCallLegHandle hCallLeg; /*Handle to the call-leg.*/
RvChar *strFrom = "From:sip:user1@172.20.0.1:5060";
RvChar *strTo = "To:sip:user2@172.20.10.11:5060";
RvStatus rv;
/*--------------------------
Creates a new call-leg.
----------------------------*/
rv = RvSipCallLegMgrCreateCallLeg(hCallLegMgr,NULL,&hCallLeg);
if(rv != RV_OK)
{
printf("Failed to create new call-leg\n");
return;