Browse code

core: renamed [set|get]RtpRelayInterface into [set|get]RtpInterface

Raphael Coeffic authored on 01/07/2013 13:28:55
Showing 7 changed files
... ...
@@ -256,7 +256,7 @@ void SBCCallLeg::applyAProfile()
256 256
 	"disabled symmetric RTP (normal mode)");
257 257
 
258 258
     if (call_profile.aleg_rtprelay_interface_value >= 0) {
259
-      setRtpRelayInterface(call_profile.aleg_rtprelay_interface_value);
259
+      setRtpInterface(call_profile.aleg_rtprelay_interface_value);
260 260
       DBG("using RTP interface %i for A leg\n", rtp_interface);
261 261
     }
262 262
 
... ...
@@ -370,7 +370,7 @@ void SBCCallLeg::applyBProfile()
370 370
   if (call_profile.rtprelay_enabled || call_profile.transcoder.isActive()) {
371 371
 
372 372
     if (call_profile.rtprelay_interface_value >= 0)
373
-      setRtpRelayInterface(call_profile.rtprelay_interface_value);
373
+      setRtpInterface(call_profile.rtprelay_interface_value);
374 374
 
375 375
     setRtpRelayForceSymmetricRtp(call_profile.force_symmetric_rtp_value);
376 376
     DBG("%s\n",getRtpRelayForceSymmetricRtp() ?
... ...
@@ -184,7 +184,7 @@ void B2BMediaStatistics::getReport(const AmArg &args, AmArg &ret)
184 184
 
185 185
 void AudioStreamData::initialize(AmB2BSession *session)
186 186
 {
187
-  stream = new AmRtpAudio(session, session->getRtpRelayInterface());
187
+  stream = new AmRtpAudio(session, session->getRtpInterface());
188 188
   stream->setRtpRelayTransparentSeqno(session->getRtpRelayTransparentSeqno());
189 189
   stream->setRtpRelayTransparentSSRC(session->getRtpRelayTransparentSSRC());
190 190
   force_symmetric_rtp = session->getRtpRelayForceSymmetricRtp();
... ...
@@ -226,7 +226,7 @@ void AudioStreamData::changeSession(AmB2BSession *session)
226 226
       force_symmetric_rtp = session->getRtpRelayForceSymmetricRtp();
227 227
       enable_dtmf_transcoding = session->getEnableDtmfTranscoding();
228 228
       session->getLowFiPLs(lowfi_payloads);
229
-      stream->setLocalIP(session->advertisedIP());
229
+      stream->setLocalIP(session->localMediaIP());
230 230
       ...
231 231
       }*/
232 232
     }
... ...
@@ -469,8 +469,8 @@ void AudioStreamData::mute(bool set_mute)
469 469
 //////////////////////////////////////////////////////////////////////////////////
470 470
 
471 471
 AmB2BMedia::RelayStreamPair::RelayStreamPair(AmB2BSession *_a, AmB2BSession *_b)
472
-: a(_a, _a ? _a->getRtpRelayInterface() : -1),
473
-  b(_b, _b ? _b->getRtpRelayInterface() : -1)
472
+: a(_a, _a ? _a->getRtpInterface() : -1),
473
+  b(_b, _b ? _b->getRtpInterface() : -1)
474 474
 { }
475 475
 
476 476
 AmB2BMedia::AmB2BMedia(AmB2BSession *_a, AmB2BSession *_b): 
... ...
@@ -883,8 +883,8 @@ void AmB2BSession::setRtpRelayMode(RTPRelayMode mode)
883 883
   rtp_relay_mode = mode;
884 884
 }
885 885
 
886
-void AmB2BSession::setRtpRelayInterface(int relay_interface) {
887
-  DBG("setting RTP relay interface for session '%s' to %i\n",
886
+void AmB2BSession::setRtpInterface(int relay_interface) {
887
+  DBG("setting RTP interface for session '%s' to %i\n",
888 888
       getLocalTag().c_str(), relay_interface);
889 889
   rtp_interface = relay_interface;
890 890
 }
... ...
@@ -293,7 +293,7 @@ private:
293 293
   bool getEnableDtmfTranscoding() const { return enable_dtmf_transcoding; }
294 294
   void getLowFiPLs(vector<SdpPayload>& lowfi_payloads) const;
295 295
 
296
-  virtual void setRtpRelayInterface(int relay_interface);
296
+  virtual void setRtpInterface(int relay_interface);
297 297
   virtual void setRtpRelayForceSymmetricRtp(bool force_symmetric);
298 298
   void setRtpRelayTransparentSeqno(bool transparent);
299 299
   void setRtpRelayTransparentSSRC(bool transparent);
... ...
@@ -147,7 +147,7 @@ void AmRtpStream::setLocalPort(unsigned short p)
147 147
     return;
148 148
   
149 149
   if(l_if < 0) {
150
-    if (session) l_if = session->getRtpRelayInterface();
150
+    if (session) l_if = session->getRtpInterface();
151 151
     else {
152 152
       ERROR("BUG: no session when initializing RTP stream, invalid interface can be used\n");
153 153
       l_if = 0;
... ...
@@ -1237,9 +1237,8 @@ void AmSession::onFailure()
1237 1237
   // }
1238 1238
 }
1239 1239
 
1240
-// Utility for basic NAT handling: allow the config file to specify the IP
1241
-// address to use in SDP bodies 
1242
-string AmSession::advertisedIP(int addrType)
1240
+
1241
+int AmSession::getRtpInterface()
1243 1242
 {
1244 1243
   if(rtp_interface < 0){
1245 1244
     // TODO: get default media interface for signaling IF instead
... ...
@@ -1250,6 +1249,16 @@ string AmSession::advertisedIP(int addrType)
1250 1249
       rtp_interface = 0;
1251 1250
     }
1252 1251
   }
1252
+  return rtp_interface;
1253
+}
1254
+
1255
+
1256
+// Utility for basic NAT handling: allow the config file to specify the IP
1257
+// address to use in SDP bodies 
1258
+string AmSession::advertisedIP(int addrType)
1259
+{
1260
+  // sets rtp_interface if not initialized
1261
+  getRtpInterface();
1253 1262
   
1254 1263
   assert(rtp_interface >= 0);
1255 1264
   assert((unsigned int)rtp_interface < AmConfig::RTP_Ifs.size());
... ...
@@ -617,7 +617,7 @@ public:
617 617
 
618 618
   virtual void onAfterRTPRelay(AmRtpPacket* p, sockaddr_storage* remote_addr) {}
619 619
 
620
-  int getRtpRelayInterface() { return rtp_interface<0 ? dlg->getOutboundIf() : rtp_interface; }
620
+  int getRtpInterface();
621 621
 };
622 622
 
623 623
 inline AmRtpAudio* AmSession::RTPStream() {