11#define RESIPROCATE_SUBSYSTEM Subsystem::DUM
25 DebugLog(<<
"First keep alive for id=" <<
mCurrentId <<
": " << target <<
", interval="
26 << keepAliveInterval <<
"s, supportsOutbound=" << (targetSupportsOutbound ?
"true" :
"false"));
37 if(targetSupportsOutbound)
44 stack.
post(t, keepAliveInterval,
mDum);
50 it->second.refCount++;
51 if(keepAliveInterval < it->second.keepAliveInterval)
55 it->second.keepAliveInterval = keepAliveInterval;
57 if(targetSupportsOutbound)
61 it->second.supportsOutbound = targetSupportsOutbound;
63 DebugLog(<<
"Association added for keep alive id=" << it->second.id <<
": " << target
64 <<
", interval=" << it->second.keepAliveInterval <<
"s, supportsOutbound="
65 << (it->second.supportsOutbound ?
"true" :
"false")
66 <<
", refCount=" << it->second.refCount);
76 if (0 == --it->second.refCount)
78 DebugLog(<<
"Last association removed for keep alive id=" << it->second.id <<
": " << target);
83 DebugLog(<<
"Association removed for keep alive id=" << it->second.id <<
": " << target <<
", refCount=" << it->second.refCount);
97 DebugLog(<<
"Refreshing keepalive for id=" << it->second.id <<
": " << it->first
98 <<
", interval=" << it->second.keepAliveInterval <<
"s, supportsOutbound="
99 << (it->second.supportsOutbound ?
"true" :
"false")
100 <<
", refCount=" << it->second.refCount);
111 DebugLog( <<
"Starting pong timeout for keepalive id " << it->second.id);
116 it->second.pongReceivedForLastPing =
false;
120 if(it->second.supportsOutbound)
127 stack.
post(t, it->second.keepAliveInterval,
mDum);
139 if(!it->second.pongReceivedForLastPing)
142 InfoLog(<<
"Timed out expecting pong response for keep alive id=" << it->second.id <<
": " << it->first);
154 DebugLog(<<
"Received pong response for keep alive id=" << it->second.id <<
": " << it->first);
155 it->second.pongReceivedForLastPing =
true;
#define resip_assert(x)
This file needs to work for both C and C++ code.
static int jitterValue(int input, int lowerPercentage, int upperPercentage, int minimum=0)
Used to jitter the expires in a SUBSCRIBE or REGISTER expires header.
static int getOutboundVersion()
virtual void process(KeepAliveTimeout &timeout)
virtual void remove(const Tuple &target)
static int mKeepAlivePongTimeoutMs
NetworkAssociationMap mNetworkAssociations
DialogUsageManager * mDum
virtual void add(const Tuple &target, int keepAliveInterval, bool targetSupportsOutbound)
virtual void receivedPong(const Tuple &flow)
const Tuple & target() const
const Tuple & target() const
This is the primary point of interaction between the app-layer and the stack.
void terminateFlow(const resip::Tuple &flow)
void post(std::unique_ptr< ApplicationMessage > message, unsigned int secondsLater, TransactionUser *tu=0)
Makes the message available to the TU at some later time, specified in seconds.
void sendTo(std::unique_ptr< SipMessage > msg, const Uri &uri, TransactionUser *tu=0)
this is only if you want to send to a destination not in the route.
void postMS(std::unique_ptr< ApplicationMessage > message, unsigned int ms, TransactionUser *tu=0)
Makes the message available to the TU at some later time, specified in milli-seconds.
Represents a network address.
dcm! – add UnusedChecking(_enum) below;
bool isReliable(TransportType type)
Returns true if passed in transport type is a reliable transport protocol.
bool pongReceivedForLastPing