Browse code

sbc: added bleg_keep_vias

Allows for selecting separately whether Via-HFs should be relayed in one direction or the other.

Raphael Coeffic authored on 30/09/2013 11:57:01 • Václav Kubart committed on 16/10/2013 09:19:55
Showing 3 changed files
... ...
@@ -427,7 +427,8 @@ int SBCCallLeg::relayEvent(AmEvent* ev)
427 427
             return res;
428 428
           }
429 429
 
430
-	  if(call_profile.keep_vias) {
430
+	  if((a_leg && call_profile.keep_vias)
431
+	     || (!a_leg && call_profile.bleg_keep_vias)) {
431 432
 	    req_ev->req.hdrs = req_ev->req.vias + req_ev->req.hdrs;
432 433
 	  }
433 434
         }
... ...
@@ -909,7 +910,7 @@ void SBCCallLeg::onInvite(const AmSipRequest& req)
909 910
   // codecs filtered out might be used in direction to caller
910 911
   CallLeg::onInvite(req);
911 912
 
912
-  if(call_profile.keep_vias)
913
+  if(a_leg && call_profile.keep_vias)
913 914
     invite_req.hdrs = invite_req.vias + invite_req.hdrs;
914 915
 
915 916
   // call extend call controls
... ...
@@ -129,6 +129,7 @@ struct SBCCallProfile
129 129
   bool transparent_dlg_id;
130 130
   bool dlg_nat_handling;
131 131
   bool keep_vias;
132
+  bool bleg_keep_vias;
132 133
 
133 134
   string outbound_proxy;
134 135
   bool force_outbound_proxy;
... ...
@@ -295,7 +296,7 @@ struct SBCCallProfile
295 296
   : auth_enabled(false),
296 297
     transparent_dlg_id(false),
297 298
     dlg_nat_handling(false),
298
-    keep_vias(false),
299
+    keep_vias(false),bleg_keep_vias(false),
299 300
     sst_enabled_value(false),
300 301
     rtprelay_enabled(false),
301 302
     force_symmetric_rtp_value(false),
... ...
@@ -393,7 +393,7 @@ int SimpleRelayDialog::initUAS(const AmSipRequest& req,
393 393
   reply_translations = cp.reply_translations;
394 394
   append_headers = cp.aleg_append_headers_req;
395 395
   transparent_dlg_id = cp.transparent_dlg_id;
396
-  keep_vias = cp.keep_vias;
396
+  keep_vias = cp.bleg_keep_vias;
397 397
 
398 398
   return 0;
399 399
 }