summaryrefslogtreecommitdiff
path: root/rtpSessionTable.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-03-17 18:48:16 +0000
committerChristian Pointner <equinox@anytun.org>2008-03-17 18:48:16 +0000
commitdc3e77c4284b84b71ddabf1a813b18224b775217 (patch)
tree18703ca611ac1ba8719219d11fae5e6c434c23f7 /rtpSessionTable.cpp
parentfirst working version (diff)
finally added callIdQueue (sorry)
threads get started @ sync now TODO: cleanup threads and session on daed
Diffstat (limited to 'rtpSessionTable.cpp')
-rw-r--r--rtpSessionTable.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/rtpSessionTable.cpp b/rtpSessionTable.cpp
index 8b361a4..5beb3d6 100644
--- a/rtpSessionTable.cpp
+++ b/rtpSessionTable.cpp
@@ -54,21 +54,7 @@ RtpSessionTable::~RtpSessionTable()
{
}
-void RtpSessionTable::addSession(const std::string & call_id, RtpSession* ses )
-{
- Lock lock(mutex_);
-
-
- std::pair<RtpSessionMap::iterator, bool> ret = map_.insert(RtpSessionMap::value_type(call_id,ses));
- if(!ret.second)
- {
- map_.erase(ret.first);
- map_.insert(RtpSessionMap::value_type(call_id,ses));
- }
-}
-
-
-void RtpSessionTable::delSession(const std::string & call_id )
+void RtpSessionTable::delSession(const std::string & call_id)
{
Lock lock(mutex_);
@@ -93,9 +79,9 @@ RtpSession& RtpSessionTable::getOrNewSessionUnlocked(const std::string & call_id
return *(it->second);
is_new = true;
- map_.insert(RtpSessionMap::value_type(call_id, new RtpSession()));
- it = map_.find(call_id);
- return *(it->second);
+ std::pair<RtpSessionMap::iterator, bool> ret = map_.insert(RtpSessionMap::value_type(call_id, NULL));
+ ret.first->second = new RtpSession(ret.first->first);
+ return *(ret.first->second);
}
RtpSession& RtpSessionTable::getSession(const std::string & call_id)