Browse code

sbc: introduce aleg_force_symmetric_rtp to separate the setting on from the other side.

Raphael Coeffic authored on 23/01/2013 11:20:37
Showing 3 changed files
... ...
@@ -208,10 +208,10 @@ void SBCCallLeg::applyAProfile()
208 208
   if (call_profile.rtprelay_enabled || call_profile.transcoder.isActive()) {
209 209
     DBG("Enabling RTP relay mode for SBC call\n");
210 210
 
211
-    if (call_profile.force_symmetric_rtp_value) {
212
-      DBG("forcing symmetric RTP (passive mode)\n");
213
-      rtp_relay_force_symmetric_rtp = true;
214
-    }
211
+    rtp_relay_force_symmetric_rtp = call_profile.aleg_force_symmetric_rtp_value;
212
+    DBG(rtp_relay_force_symmetric_rtp ? 
213
+	"forcing symmetric RTP (passive mode)\n": 
214
+	"disabled symmetric RTP (normal mode)\n");
215 215
 
216 216
     if (call_profile.aleg_rtprelay_interface_value >= 0) {
217 217
       setRtpRelayInterface(call_profile.aleg_rtprelay_interface_value);
... ...
@@ -323,8 +323,14 @@ void SBCCallLeg::applyBProfile()
323 323
 
324 324
   // was read from caller but reading directly from profile now
325 325
   if (call_profile.rtprelay_enabled || call_profile.transcoder.isActive()) {
326
+
326 327
     if (call_profile.rtprelay_interface_value >= 0)
327 328
       setRtpRelayInterface(call_profile.rtprelay_interface_value);
329
+
330
+    rtp_relay_force_symmetric_rtp = call_profile.force_symmetric_rtp_value;
331
+    DBG(rtp_relay_force_symmetric_rtp ? 
332
+	"forcing symmetric RTP (passive mode)\n": 
333
+	"disabled symmetric RTP (normal mode)\n");
328 334
   }
329 335
 
330 336
   setRtpRelayTransparentSeqno(call_profile.rtprelay_transparent_seqno);
... ...
@@ -334,7 +334,8 @@ bool SBCCallProfile::readFromConfiguration(const string& name,
334 334
   refuse_with = cfg.getParameter("refuse_with");
335 335
 
336 336
   rtprelay_enabled = cfg.getParameter("enable_rtprelay") == "yes";
337
-  force_symmetric_rtp = cfg.getParameter("rtprelay_force_symmetric_rtp");
337
+  aleg_force_symmetric_rtp = cfg.getParameter("rtprelay_force_symmetric_rtp");
338
+  force_symmetric_rtp = aleg_force_symmetric_rtp;
338 339
   msgflags_symmetric_rtp = cfg.getParameter("rtprelay_msgflags_symmetric_rtp") == "yes";
339 340
 
340 341
   rtprelay_interface = cfg.getParameter("rtprelay_interface");
... ...
@@ -731,6 +732,7 @@ bool SBCCallProfile::evaluate(ParamReplacerCtx& ctx,
731 732
     // evaluate other RTP relay related params only if enabled
732 733
     // FIXME: really not evaluate rtprelay_enabled itself?
733 734
     REPLACE_BOOL(force_symmetric_rtp, force_symmetric_rtp_value);
735
+    REPLACE_BOOL(aleg_force_symmetric_rtp, aleg_force_symmetric_rtp_value);
734 736
 
735 737
     // enable symmetric RTP by P-MsgFlags?
736 738
     // SBC need not to know if it is from P-MsgFlags or from profile parameter
... ...
@@ -744,6 +746,7 @@ bool SBCCallProfile::evaluate(ParamReplacerCtx& ctx,
744 746
       if (msg_flags & FL_FORCE_ACTIVE) {
745 747
         DBG("P-MsgFlags indicates forced symmetric RTP (passive mode)");
746 748
         force_symmetric_rtp_value = true;
749
+	aleg_force_symmetric_rtp_value = true;
747 750
       }
748 751
     }
749 752
 
... ...
@@ -149,7 +149,10 @@ struct SBCCallProfile
149 149
 
150 150
   bool rtprelay_enabled;
151 151
   string force_symmetric_rtp;
152
+  string aleg_force_symmetric_rtp;
152 153
   bool force_symmetric_rtp_value;
154
+  bool aleg_force_symmetric_rtp_value;
155
+
153 156
   bool msgflags_symmetric_rtp;
154 157
   bool rtprelay_transparent_seqno;
155 158
   bool rtprelay_transparent_ssrc;