[prev in list] [next in list] [prev in thread] [next in thread] 

List:       semsdev
Subject:    [Semsdev] git:1.5: b/f: give media c-line precendece over session c-line
From:       Stefan Sayer <stefan.sayer () googlemail ! com>
Date:       2012-08-09 15:35:03
Message-ID: 20120809153503.E1234EF804E () rimmer ! ryngle ! com
[Download RAW message or body]

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


Author: Stefan Sayer <stefan.sayer@googlemail.com>
Committer: Stefan Sayer <stefan.sayer@googlemail.com>
Date:   Thu Aug  9 17:32:05 2012 +0200

b/f: give media c-line precendece over session c-line

based on a patch by Emil Kroymann

---

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

diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp
index 226e925..f5c115d 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -623,14 +623,25 @@ int AmRtpStream::init(const AmSdp& local,
     ++sdp_it;
   }
 
-  if (local.conn.address.empty()) setLocalIP(local_media.conn.address);
-  else setLocalIP(local.conn.address);
+  // 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);
-  if (remote.conn.address.empty()) setRAddr(remote_media.conn.address, \
                remote_media.port);
-  else setRAddr(remote.conn.address, remote_media.port);
 
-  if(local_media.payloads.empty()) {
+  // set remote address - media c-line having precedence over session c-line
+  if (remote.conn.address.empty() && remote_media.conn.address.empty()) {
+    WARN("no c= line given globally or in m= section in remote SDP\n");
+    return -1;
+  }
+  if (remote_media.conn.address.empty())
+    setRAddr(remote.conn.address, remote_media.port);
+  else
+    setRAddr(remote_media.conn.address, remote_media.port);
 
+  if(local_media.payloads.empty()) {
     ERROR("local_media.payloads.empty()\n");
     return -1;
   }

_______________________________________________
Semsdev mailing list
Semsdev@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/semsdev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic