HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
66 HP-UX C SIP Stack Programmer’s Guide
Using the Outbound Message Mechanism
/*===================================================================================*/
RvStatus AppCallModify(IN RvSipCallLegHandle hCallLeg)
{
RvStatus rv = RV_OK;
RvSipCallLegInviteHandle hReInvite;
/* 1. Create a re-INVITE object */
rv = RvSipCallLegReInviteCreate(hCallLeg, NULL, &hReInvite);
if (RV_OK != rv)
{
printf("RvSipCallLegReInviteCreate() failed (rv=%d)", rv);
return rv;
}
/* 2. Here we can set parameters to the call-leg outbound msg */
/* 3. Send the re-INVITE request */
rv = RvSipCallLegReInviteRequest(hCallLeg, hReInvite);
if (RV_OK != rv)
{
printf("RvSipCallLegReInviteRequest() failed (rv=%d)", rv);
return rv;
}
return rv;
}
/*===================================================================================*/
USING THE
OUTBOUND
M
ESSAGE
M
ECHANISM
The outbound message mechanism enables adding fields to the message before
calling the function that actually sends the message. The following sample code
demonstrates how to add a “Subject: Hello” header to the initial INVITE
request.
Note In this sample, the return value of the SIP Stack API functions is not
checked for simplicity. You must always check return values.
/*===================================================================*/
void AppConnectCallWithSubject(IN RvSipCallLegMgrHandle hCallLegMgr)
{
RvSipCallLegHandle hCallLeg;
RvSipMsgHandle hMsg;
RvSipOtherHeaderHandle hSubject;