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

Working with DNS 339
Manipulating the DNS List Object
/*=========================================================================================*/
RvStatus ReplaceTopMostIp(IN RvSipTranscHandle hTransaction,
IN RvSipTransportMgrHandle hTransportMgr)
{
RvStatus rv = RV_OK;
RvSipTransportDNSListHandle hDnsList = NULL;
RvChar strIP="172.3.4.45";
RvSipTransportDNSIPElement element;
/*Obtains the DNS list from the transaction.*/
rv = RvSipTransactionDNSGetList(hTransaction, &hDnsList);
if (rv != RV_OK)
{
return rv;
}
/*Removes the topmost IP address from the list.*/
rv = RvSipTransportDNSListRemoveTopmostIPElement (hTransportMgr,hDnsList)
if (rv != RV_OK)
{
return rv;
}
/*Prepares the new IP element to include in the list.*/
rv = RvSipTransportConvertStringToIp(
hTransportMgr,
strIP,
RVSIP_TRANSPORT_ADDRESS_TYPE_IP,
&element.ip);
if (rv != RV_OK)
{
return rv;
}
element.protocol = RVSIP_TRANSPORT_UDP;
element.port = 5060;
element.bIsIpV6 = RV_FALSE;
/*Pushes the element into the list.*/
rv = RvSipTransportDNSListPushIPElement(hTransportMgr, hDnsList, &element);
if (rv != RV_OK)
{