Browse code

sbc: support for adding contact parameters (AmBasicSipDialog::contact_params)

Raphael Coeffic authored on 01/10/2013 15:48:19 • Václav Kubart committed on 16/10/2013 09:19:56
Showing 4 changed files
... ...
@@ -288,6 +288,9 @@ void SBCCallLeg::applyAProfile()
288 288
     // copy stats counters
289 289
     rtp_pegs = call_profile.aleg_rtp_counters;
290 290
   }
291
+
292
+  if(!call_profile.dlg_contact_params.empty())
293
+    dlg->setContactParams(call_profile.dlg_contact_params);
291 294
 }
292 295
 
293 296
 int SBCCallLeg::applySSTCfg(AmConfigReader& sst_cfg, 
... ...
@@ -395,6 +398,9 @@ void SBCCallLeg::applyBProfile()
395 398
   // was read from caller but reading directly from profile now
396 399
   if (!call_profile.callid.empty()) 
397 400
     dlg->setCallid(call_profile.callid);
401
+
402
+  if(!call_profile.bleg_dlg_contact_params.empty())
403
+    dlg->setContactParams(call_profile.bleg_dlg_contact_params);
398 404
 }
399 405
 
400 406
 int SBCCallLeg::relayEvent(AmEvent* ev)
... ...
@@ -747,6 +747,9 @@ bool SBCCallProfile::evaluate(ParamReplacerCtx& ctx,
747 747
   REPLACE_NONEMPTY_STR(to);
748 748
   REPLACE_NONEMPTY_STR(callid);
749 749
 
750
+  REPLACE_NONEMPTY_STR(dlg_contact_params);
751
+  REPLACE_NONEMPTY_STR(bleg_dlg_contact_params);
752
+
750 753
   REPLACE_NONEMPTY_STR(outbound_proxy);
751 754
   REPLACE_NONEMPTY_STR(next_hop);
752 755
 
... ...
@@ -126,6 +126,9 @@ struct SBCCallProfile
126 126
 
127 127
   string callid;
128 128
 
129
+  string dlg_contact_params;
130
+  string bleg_dlg_contact_params;
131
+
129 132
   bool transparent_dlg_id;
130 133
   bool dlg_nat_handling;
131 134
   bool keep_vias;
... ...
@@ -367,6 +367,9 @@ int SimpleRelayDialog::initUAC(const AmSipRequest& req,
367 367
   append_headers = cp.append_headers_req;
368 368
   keep_vias = cp.keep_vias;
369 369
 
370
+  if(!cp.bleg_dlg_contact_params.empty())
371
+    setContactParams(cp.bleg_dlg_contact_params);
372
+
370 373
   return 0;
371 374
 }
372 375
 
... ...
@@ -395,6 +398,9 @@ int SimpleRelayDialog::initUAS(const AmSipRequest& req,
395 398
   transparent_dlg_id = cp.transparent_dlg_id;
396 399
   keep_vias = cp.bleg_keep_vias;
397 400
 
401
+  if(!cp.dlg_contact_params.empty())
402
+    setContactParams(cp.dlg_contact_params);
403
+
398 404
   return 0;
399 405
 }
400 406