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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Fri Feb  3 12:01:19 2012 +0100

core: removed unneeded relay_rtp_interface.

used to duplicate the functionality of AmSession::rtp_interface.

---

 apps/sbc/SBC.cpp      |    2 +-
 core/AmB2BSession.cpp |   22 ++++++++++------------
 core/AmB2BSession.h   |    3 +--
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/apps/sbc/SBC.cpp b/apps/sbc/SBC.cpp
index 7c35501..1f45c61 100644
--- a/apps/sbc/SBC.cpp
+++ b/apps/sbc/SBC.cpp
@@ -777,7 +777,7 @@ void SBCDialog::onInvite(const AmSipRequest& req)
            throw AmSession::Exception(500, SIP_REPLY_SERVER_INTERNAL_ERROR);
          }
        }
-       DBG("using RTP relay interface %i for A leg\n", relay_rtp_interface);
+       DBG("using RTP interface %i for A leg\n", rtp_interface);
       }
     }
 
diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp
index e853aae..06787c3 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -44,7 +44,6 @@ AmB2BSession::AmB2BSession(const string& other_local_tag)
     b2b_mode(B2BMode_Transparent),
     rtp_relay_enabled(false),
     rtp_relay_force_symmetric_rtp(false),
-    relay_rtp_interface(-1),
     relay_rtp_streams(NULL), relay_rtp_streams_cnt(0),
     rtp_relay_transparent_seqno(true), rtp_relay_transparent_ssrc(true),
     est_invite_cseq(0),est_invite_other_cseq(0)
@@ -318,10 +317,10 @@ void AmB2BSession::updateRelayStreams(const string& 
content_type, const string&
     relay_rtp_streams = new AmRtpStream*[relay_rtp_streams_cnt];
     for(unsigned int i=0; i<relay_rtp_streams_cnt; i++){
       // create relay stream on set interface, else dlg interface
-      int used_relay_interface = relay_rtp_interface<0 ?
-       dlg.getOutboundIf() : relay_rtp_interface;
-      DBG("using relay interface %i (relay_rtp_interface=%i)\n",
-         used_relay_interface, relay_rtp_interface);
+      int used_relay_interface = rtp_interface<0 ?
+       dlg.getOutboundIf() : rtp_interface;
+      DBG("using relay interface %i (rtp_interface=%i)\n",
+         used_relay_interface, rtp_interface);
       relay_rtp_streams[i] = new AmRtpStream(NULL, used_relay_interface);
       
relay_rtp_streams[i]->setRtpRelayTransparentSeqno(rtp_relay_transparent_seqno);
       
relay_rtp_streams[i]->setRtpRelayTransparentSSRC(rtp_relay_transparent_ssrc);
@@ -382,10 +381,10 @@ bool AmB2BSession::replaceConnectionAddress(const string& 
content_type,
   }
 
   string relay_address;
-  if (relay_rtp_interface >= 0 && (unsigned)relay_rtp_interface < 
AmConfig::Ifs.size()) {
-    relay_address = AmConfig::Ifs[relay_rtp_interface].PublicIP.empty() ?
-      AmConfig::Ifs[relay_rtp_interface].LocalIP :
-      AmConfig::Ifs[relay_rtp_interface].PublicIP;
+  if (rtp_interface >= 0 && (unsigned)rtp_interface < AmConfig::Ifs.size()) {
+    relay_address = AmConfig::Ifs[rtp_interface].PublicIP.empty() ?
+      AmConfig::Ifs[rtp_interface].LocalIP :
+      AmConfig::Ifs[rtp_interface].PublicIP;
   } else {
     relay_address = advertisedIP();
   }
@@ -873,8 +872,8 @@ void AmB2BSession::setupRelayStreams(AmB2BSession* 
other_session) {
     relay_rtp_streams = new AmRtpStream*[relay_rtp_streams_cnt];
     for(unsigned int i=0; i<relay_rtp_streams_cnt; i++){
       // create relay stream on set interface, else dlg interface
-      relay_rtp_streams[i] = new AmRtpStream(NULL, relay_rtp_interface<0 ?
-                                            dlg.getOutboundIf() : 
relay_rtp_interface);
+      relay_rtp_streams[i] = new AmRtpStream(NULL, rtp_interface<0 ?
+                                            dlg.getOutboundIf() : 
rtp_interface);
       
relay_rtp_streams[i]->setRtpRelayTransparentSeqno(rtp_relay_transparent_seqno);
       
relay_rtp_streams[i]->setRtpRelayTransparentSSRC(rtp_relay_transparent_ssrc);
     }
@@ -892,7 +891,6 @@ void AmB2BSession::setupRelayStreams(AmB2BSession* 
other_session) {
 void AmB2BSession::setRtpRelayInterface(int relay_interface) {
   DBG("setting RTP relay interface for session '%s' to %i\n",
       getLocalTag().c_str(), relay_interface);
-  relay_rtp_interface = relay_interface;
   rtp_interface = relay_interface;
 }
 
diff --git a/core/AmB2BSession.h b/core/AmB2BSession.h
index 95a3698..0515bfa 100644
--- a/core/AmB2BSession.h
+++ b/core/AmB2BSession.h
@@ -241,8 +241,7 @@ class AmB2BSession: public AmSession
   AmRtpStream** relay_rtp_streams;
   /** number of relay RTP streams */
   unsigned int relay_rtp_streams_cnt;
-  /** interface where relay streams are created */
-  int relay_rtp_interface;
+
   /** fd of the other streams' sockets (to remove from
       RtpReceiver at end of relaying) */
   int other_stream_fds[MAX_RELAY_STREAMS];

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

Reply via email to