HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with DNS 341
DNS Caching
REGISTER-CLIENT
L
AYER
The RVSIP_REG_CLIENT_STATE_MSG_SEND_FAILURE state indicates a
message send failure. The application can obtain the DNS List object handle by
calling the RvSipRegClientDNSGetList() function. Once the application has a
handle to the list, it can manipulate the list using the Transport API.
R
EGISTER- CLIENT DNS
API
Calling the RvSipRegClientDNSContinue() function causes the SIP Stack to
prepare an internal cloned transaction and terminate the original transaction. If
the application wishes, it can call RvSipRegClientGetOutboundMsg() and
manipulate the message before sending it. To actually try and send the message
to the next address in the DNS list, the application should call the
RvSipRegClientDNSReSendRequest() function. Calling
RvSipRegClientDNSGiveUp() indicates that the application does not want to
keep trying to send the message, and will terminate the register-client.
CHANGING DNS LIST
BEFORE MESSAGE IS
SENT
Each SIP Stack object (call-leg, register-client, and so on) has an
RvSipXXXXFinalDestResolvedEv() callback. In this callback, it is possible to
obtain the DNS list and manipulate it. You can use
RvSipTransactionGetTransmitter() to obtain the transmitter of the sending
transaction and perform different operations on the transmitter, as follows:
1. Call RvSipTransmitterDNSGetList() to obtain the DNS list
held by the transmitter.
2. Call the functions described in Manipulating the DNS List
Object to manipulate the list.
3. You can also call RvSipTransmitterSetDestAddress() to
implicitly set the address to which the message will be sent.
To change the DNS list asynchroniously:
1. Call RvSipTransmitterHoldSending() to hold the sending of
the message. While the SIP Stack holds the message, you can
perform DNS manipulation on the DNS list held by the
transmitter.
2. Once you are done with DNS manipulation, you can call
RvSipTransmitterResumeSending() to complete the message
sending.
For more information, see the Working with Transmitters chapter.
DNS CACHING The SIP Stack can be configured to support DNS caching. When DNS caching
is enabled, positive and negative DNS answers are kept in the caching module
for further usage. The module caches positive answers from the DNS server
according the TTL value found in the DNS response.