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

306 HP-UX C SIP Stack Programmers Guide
Server Connections
serverConnectionTimeout = –1
The SIP Stack never closes Server connections, which always
wait to be closed by the connection initiator. This is also the
default behavior of the SIP Stack.
serverConnectionTimeout > 0
When the last owner detaches from the connection, a timer with
the value of “serverConnectionTimeout” is set. The SIP Stack
will close the connection when the timer expires. If in that time
a new owner will attach itself to the connection (a message will
be received on the connection), the timer will be stopped.
Sample Code
The following sample code demonstrates how an application can inspect
incoming connections. Registration of the application to the callback is not
shown.
/*=====================================================================*/
static RvStatus RVCALLCONV AppTransportConnectionCreatedEv(
IN RvSipTransportMgrHandle hTransportMgr,
IN RvSipAppTransportMgrHandle hAppTransportMgr,
IN RvSipTransportConnectionHandle hConn,
OUT RvSipTransportConnectionAppHandle *phAppConn,
OUT RvBool *pbDrop)
{
RvStatus rv;
RvChar strIPLocal[RVSIP_TRANSPORT_LEN_STRING_IP];
RvChar strIPRemote[RVSIP_TRANSPORT_LEN_STRING_IP];
RvUint16 portLocal;
RvUint16 portRemote;
RvSipTransportAddressType eAddressType;
rv = RvSipTransportConnectionGetLocalAddress(hConn,strIPLocal, &portLocal,
&eAddressType);
if (RV_OK != rv)
{
printf(“RvSipTransportConnectionGetLocalAddress() failed”);
*pbDrop = RV_TRUE;
}
rv = RvSipTransportConnectionGetRemoteAddress(hConn,strIPRemote,
&portRemote, &eAddressType);
if (RV_OK != rv)