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

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 f5c115d..34c229e 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -623,11 +623,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