11. ALTERNATE-SERVER Mechanism
This section describes a mechanism in STUN that allows a server to redirect a client to another server. This extension is optional, and a usage must define if and when this extension is used.
A server using this extension redirects a client to another server by replying to a request message with an error response message with an error code of 300 (Try Alternate). The server MUST include an ALTERNATE-SERVER attribute in the error response. The error response message MAY be authenticated; however, in some cases where ALTERNATE-SERVER is used, authenticating the response may not be possible or practical.
A client using this extension handles a 300 (Try Alternate) error code as follows. The client looks for an ALTERNATE-SERVER attribute in the error response. If one is found, the client considers the current transaction as failed, and reattempts the request with the server specified in the attribute, using the same transport protocol used for the previous request. That request, if authenticated, MUST utilize the same credentials that the client would have used with the server to which the request was to be made when it was sent to the server that performed the redirect. If the client has been redirected to a server to which it has already tried to send this request within the past five minutes, it MUST ignore the redirection and consider the transaction to have failed. This prevents infinite ping-pong between servers in the event of a redirection loop.