HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with Call-legs (Dialogs) 65
Making a TCP Call
/*-------------------------------------------------------
Fills the address handles with the contact information.
-----------------------------------------------------*/
rv = RvSipAddrParse(hLocalContactAddress,strLocalContactAddress);
rv1 = RvSipAddrParse(hRemoteContactAddress,strRemoteContactAddress);
if(rv != RV_OK || rv1 != RV_OK)
{
printf("Failed to fill contact addresses\n");
return;
}
/*------------------------------------------
Sets the contact address to the call-leg.
--------------------------------------------*/
rv = RvSipCallLegSetLocalContactAddress(hCallLeg,hLocalContactAddress);
rv1 = RvSipCallLegSetRemoteContactAddress(hCallLeg,hRemoteContactAddress);
if(rv != RV_OK || rv1 != RV_OK)
{
printf("Failed to set contact addresses to call-leg\n");
return;
}
/*--------------------------------------------------------------------------------
Calls the make function with the To and From strings in order to connect the call.
--------------------------------------------------------------------------------*/
printf("Connecting a call: %s -> %s\n", strFrom, strTo);
rv = RvSipCallLegMake(hCallLeg, strFrom, strTo);
if(rv != RV_OK)
{
printf("Connect failed for call-leg");
return;
}
}
/*===================================================================================*/
Sample Code
The following sample code demonstrates sending a re-INVITE request. In this
example an outgoing re-INVITE object is created in a given call-leg and is used
to send a re-INVITE request.