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

Working with Call-legs (Dialogs) 63
Making a TCP Call
}
printf("Outgoing call-leg %x was created\n",hCallLeg);
/*---------------------------------------------------------------------------------
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;
}
}
/*===================================================================================*/
MAKING A TCP
CALL
The transport type of an initial INVITE is determined by the transport parameter
of the Request-URI. The Request-URI is taken from the remote contact
parameter of the call-leg. If the remote contact was not set, the address of the To
header is taken. According to RFC 3261, the address in the To and From headers
must not include the transport parameter. Therefore, to send an INITIAL invite
using TCP transport, you must set the call-leg remote contact parameter and
indicate that the transport is TCP. In the same way, to receive further requests on
TCP, the local contact must be set with the TCP transport.
The following steps describe how to initiate a TCP call. In this example, the user
wishes to send and receive requests using TCP and therefore, both the remote
contact and the local contact are set.
To ma ke a TCP call
1. Create a call as described in steps 1, and 2 of the sample,
Initiating a Call.
2. Get two address handles from the call-leg and fill them with
the local and remote contact addresses. Both addresses
indicates that the transport is TCP.
3. Set the local and remote contact addresses to the call-leg.
4. Call the RvSipCallLegMake() function. This functions sends
the INVITE request to the remote party. The request is sent
using TCP transport.