HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
310 HP-UX C SIP Stack Programmer’s Guide
Server Connection Reuse
SERVER SIDE When the SIP Stack receives a request message on an incoming connection, it
checks the Via header and looks for the alias parameter. The alias parameter
indicates that the originator of the request wants to create a Transport layer alias.
If the alias parameter exists, the SIP Stack consults the application whether this
connection is authorized to be reused, using the dedicated callback function,
RvSipTransportConnectionServerReuseEv().
If the application decides that this connection is authorized, it calls to
RvSipTransportConnectionEnableConnByAlias(). In this function the SIP Stack
hashes the connection with the advertised address, so the application will be able
to use this connection for sending further requests. Reusing the connection is
done simply by sending a request to the advertised address. For example, if the
application wishes to send a request to 10.54.32.1:5061 or to proxy-farm-
example.com (which are advertised addresses declared as aliases and enabled by
application) the application will simply use the addresses as the Request-URI.
During the sending process, the SIP Stack will find such a server connection in
the hash and use it.
SERVER CONNECTION
REUSE API FUNCTIONS
AND EVENTS
The Server Connection Reuse API functions and events are listed below:
RvSipTransportConnectionEnableConnByAlias()
When a request is received, and its top Via header has an alias parameter, this
connection can be reused for sending outgoing requests. However, before using
this connection, the application has to authorize it (especially when this is a TLS
connection). Only when the application is certain that this connection is
authorized it should enable the connection for future usage by calling this
function.
In this function the SIP Stack inserts the connection into the connections hash
table by its alias name. Therefore, when you try to send a request to this alias
name, the connection will be found and reused.
RvSipTransportConnectionServerReuseEv()
This callback notifies the application that a new request was received with an
alias parameter in its top Via header. The server connection should be reused,
but it has to be authorized by the application first.