HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with DNS 333
SIP Stack Implementation
When an ENUM query returns as a result of a valid URI, the Stack tries to
resolve this URI automatically, using the general URI resolution methodology.
During URI resolution, the following algorithm is used for filling the DNS list
object.
For each element (such as, host, IP):
1. Remove (pop) the element from the list.
2. Query the DNS for that element, and insert the results into the
DNS list.
3. Repeat steps 1 and 2 for the next sub-list until the IP sub-list is
filled.
This means that when the DNS querying process has ended, every DNS sub-list
(for example, hosts) will contain all the results retrieved from the DNS,
excluding the result for which the next sub-list was constructed. Finally, the
transaction will pop an IP from the IP sub-list and use it to send the request. To
view the SRV element used to build the Hosts list, call
RvSipTransportDNSListGetUsedSRVElement(). To view the host element used
to build the IP addresses list, call
RvSipTransportDNSListGetUsedHostElement().
The transaction sends a request to the first IP address found in the IP list. If a
failure occurs, the application can choose to send the request to the next element
in the list. The new request is identical to the previous, but has a different value
of the Via branch and therefore constitutes a new SIP transaction.
The new transaction will obtain the DNS List object without the IP address that
failed, and will send the request according to the supplied list. (A transaction
always uses the first IP found on its DNS List object.)
Once all IP addresses for a specific host are exhausted, the transaction will pop
a host from the host sub-list and the DNS will be queried for that host in the list.
The same procedure applies when all the hosts are exhausted, in which case the
DNS will pop the next SRV record and query the DNS for hosts, and so on.
Note Accessing DNS servers can be costly. Therefore, especially when the DNS
caching mechanism is turned off, it is recommended to limit the number of retries
using the maxElementsInSingleDnsList configuration parameter, or by manually
manipulating the list. For more information, see DNS Caching.