Skip to content

Commit

Permalink
fix 30 sec delete wait
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Jan 14, 2018
1 parent e2197cb commit f5cdae1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RasTbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2125,13 +2125,14 @@ inline void CallRec::Unlock()
--m_usedCount;
}

inline bool CallRec::IsUsed() const {
inline bool CallRec::IsUsed() const
{
if (m_usedCount != 0)
return true;
// also consider all calls that ever connected as used until 30 sec after disconnect (due to late arriving RTP)
if ((m_disconnectTime > 0) && (time(NULL) - m_disconnectTime > WAIT_DELETE_AFTER_DISCONNECT))
if ((m_disconnectTime > 0) && ((time(NULL) - m_disconnectTime) < WAIT_DELETE_AFTER_DISCONNECT))
return true;
if ((m_connectTime > 0) && (time(NULL) - m_connectTime > WAIT_DELETE_AFTER_DISCONNECT))
if ((m_connectTime > 0) && ((time(NULL) - m_connectTime) < WAIT_DELETE_AFTER_DISCONNECT))
return true;
return false;
}
Expand Down

0 comments on commit f5cdae1

Please sign in to comment.