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

334 HP-UX C SIP Stack Programmers Guide
State Machine and API Functions
STATE MACHINE
AND API
F
UNCTIONS
In general, whenever a message send has failed, the transaction moves to a new
state that indicates that failure,
RVSIP_TRANSC_STATE_CLIENT_MSG_SEND_FAILURE. In the state
change callback, the reason that is attached to the state indicates the reason of
the failure. The reason can be one of the following:
RVSIP_TRANSC_REASON_TIME_OUT
A transaction has timed out. (For example, an INVITE did not get a final
response.)
RVSIP_TRANSC_REASON_NETWORK_ERROR
A network error was reported. (For example, a TCP connection could not be
established.)
RVSIP_TRANSC_REASON_503_RECEIVED
A 503 response was received by the transaction.
In the RVSIP_TRANSC_STATE_CLIENT_MSG_SEND_FAILURE state, the
application can choose one of two actions:
Try to use the next address in the list.
Terminate the transaction.
USING THE NEXT ADDRESS IN THE LIST
In order to send the request to the next address in the list, the application must
start by calling the RvSipTransactionDNSContinue() function. Calling this
function terminates the transaction and creates a new transaction that is ready to
continue where the old transaction failed. The new transaction is a copy of the
previous transaction with a new branch value and a copy of the DNS List
(without the ENUM query result, if it exists, and the failed IP).
The application should then continue by calling the RvSipTransactionRequest()
function on the newly created transaction. The transaction will send the request
to the first IP address found on its DNS List object.
In the case where
RVSIP_TRANSC_STATE_CLIENT_MSG_SEND_FAILURE was reached
because of a 503 response on INVITE, calling