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

126 HP-UX C SIP Stack Programmers Guide
Using Transactions
RvSipTransactionGetOutboundMsg(hTransc,&hMsg);
/*Adds the 'Allow: INVITE,ACK,CANCEL,BYE,OPTIONS' header*/
RvSipAllowHeaderConstructInMsg(hMsg,RV_FALSE,&hAllow);
RvSipAllowHeaderSetMethodType(hAllow,RVSIP_METHOD_INVITE,NULL);
RvSipAllowHeaderConstructInMsg(hMsg,RV_FALSE,&hAllow);
RvSipAllowHeaderSetMethodType(hAllow,RVSIP_METHOD_ACK,NULL);
RvSipAllowHeaderConstructInMsg(hMsg,RV_FALSE,&hAllow);
RvSipAllowHeaderSetMethodType(hAllow,RVSIP_METHOD_CANCEL,NULL);
RvSipAllowHeaderConstructInMsg(hMsg,RV_FALSE,&hAllow);
RvSipAllowHeaderSetMethodType(hAllow,RVSIP_METHOD_BYE,NULL);
RvSipAllowHeaderConstructInMsg(hMsg,RV_FALSE,&hAllow);
RvSipAllowHeaderSetMethodType(hAllow,RVSIP_METHOD_OTHER,"OPTIONS");
/*Adds the 'Accept: application/' header*/
RvSipOtherHeaderConstructInMsg(hMsg,RV_FALSE,&hHeader);
RvSipOtherHeaderSetName(hHeader,"Accept");
RvSipOtherHeaderSetValue(hHeader,"application/");
/*Adds the 'Accept-Encoding: gzip' header*/
RvSipOtherHeaderConstructInMsg(hMsg,RV_FALSE,&hHeader);
RvSipOtherHeaderSetName(hHeader,"Accept-Encoding");
RvSipOtherHeaderSetValue(hHeader,"gzip");
RvSipTransactionRespond(hTransc,200,NULL);
break;
default:
break;
}
}
/*==================================================================================*/
TRANSACTION
M
ERGING SUPPORT
A proxy may fork a request to several different proxies. As a result, the UAS
may receive several request messages, with the same request identifier (Call-ID,
From tag, To tag and cseq), but with a different via-branch. Since the branch
parameter in the Via header is different, a new transaction will be created for
each request.