Module: sems
Branch: master
Commit: 51fd45870f9bbcb9eae47039202a7509fb8343f7
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=51fd45870f9bbcb9eae47039202a7509fb8343f7

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Tue Feb  7 12:04:46 2012 +0100

b/f: delay RTP outbound interface initialization.

This fixes case where the RTP stream is initialized before the SIP dialog has 
been initialized. This can be the case when RTP attribute (ex: 'receiving') are 
set from within the Session constructor (ex: announcement plug-in).

---

 core/AmRtpStream.cpp |    7 ++++---
 core/AmSession.h     |    2 --
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp
index 4bf2eba..e2edf80 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -112,11 +112,12 @@ void AmRtpStream::setLocalPort()
   if(l_port)
     return;
   
-  assert(l_if >= 0);
-  assert(l_if < (int)AmConfig::Ifs.size());
-
   if (!getLocalSocket())
     return;
+
+  if(l_if < 0) {
+    l_if = session->dlg.getOutboundIf();
+  }
   
   int retry = 10;
   unsigned short port = 0;
diff --git a/core/AmSession.h b/core/AmSession.h
index 2cd58b9..acbf6ad 100644
--- a/core/AmSession.h
+++ b/core/AmSession.h
@@ -636,8 +636,6 @@ inline AmRtpAudio* AmSession::RTPStream() {
   if (NULL == _rtp_str.get()) {
     DBG("creating RTP stream instance for session [%p]\n", 
        this);
-    if(rtp_interface < 0)
-      rtp_interface = dlg.getOutboundIf();
     _rtp_str.reset(new AmRtpAudio(this,rtp_interface));
   }
   return _rtp_str.get();

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to