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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Thu Oct  4 10:48:53 2012 +0200

rtp: only set local address on init() if socket not yet bound

---

 core/AmRtpStream.cpp |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp
index 346c74f..37b8d9f 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -664,11 +664,14 @@ int AmRtpStream::init(const AmSdp& local,
     ++sdp_it;
   }
 
-  // set local address - media c-line having precedence over session c-line
-  if (local_media.conn.address.empty())
-    setLocalIP(local.conn.address);
-  else
-    setLocalIP(local_media.conn.address);
+  if(!l_port){
+    // only if socket not yet bound:
+    // set local address - media c-line having precedence over session c-line
+    if (local_media.conn.address.empty())
+      setLocalIP(local.conn.address);
+    else
+      setLocalIP(local_media.conn.address);
+  }
 
   setPassiveMode(remote_media.dir == SdpMedia::DirActive || 
force_passive_mode);
 

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

Reply via email to