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

Working with Resolvers 347
Resolver API
domain list is set according to the configuration of the computer and is managed
by the ResolverMgr. The application can use the
RvSipResolverMgrSetDnsDomains() function to provide a new set of DNS
domains to the SIP Stack. It can use the RvSipResolverMgrGetDnsDomains()
function to get the current list of DNS domains.
Sample Code
The following sample code illustrates the use of a resolver with a DNS list.
/*=========================================================================================*/
/* Global parameters*/
static RvSipTransportMgrHandle hTransportMgr;
static RvSipResolverMgrHandle hResolverMgr;
static HRPOOL hPool;
/* A callback to process answers */
RvStatus RVCALLCONV ReportDataEvHandler(
IN RvSipResolverHandle hResolver,
IN RvSipAppResolverHandle hOwner,
IN RvBool bError,
IN RvSipResolverMode eMode)
{
RvStatus rv = RV_OK;
RvSipResolverGetDnsList hDNSlist;
if (error)
DoErrorActions();
else
{
RvChar ip[60];
RvSipTransportDNSIPElement IPElement;
RvSipResolverGetDnsList(hResolver,&hDNSlist);
RvSipTransportDNSListPopIPElement(hTransportMgr,hDNSlist,&IPElement);
RvSipTransportConvertIpToString(hTransportMgr,IPElement.ip,RVSIP_TRANSPORT_ADDRESS_
TYPE_IP,60,ip);
printf("the ip of host.com is %s", ip);
}
return RV_OK;
}