Browse code

sbc:dsm: outbound_interface for addCallee new call mode

Stefan Sayer authored on 21/12/2013 19:41:06
Showing 5 changed files
... ...
@@ -468,6 +468,12 @@ EXEC_ACTION_START(MODSBCActionAddCallee) {
468 468
     if (it != sc_sess->var.end())
469 469
       p.next_hop_fixed = (it->second == DSM_TRUE);
470 470
 
471
+    it = sc_sess->var.find(varname+"." DSM_SBC_PARAM_ADDCALLEE_OUTBOUND_INTERFACE);
472
+    if (it != sc_sess->var.end()) {
473
+      p.outbound_interface = it->second;
474
+      p.evaluateOutboundInterface();
475
+    }
476
+
471 477
     sbc_call_leg->addCallee(peer, hdrs);
472 478
   } else if (mode == DSM_SBC_PARAM_ADDCALLEE_MODE_LTAG) {
473 479
     string ltag;
... ...
@@ -833,6 +833,12 @@ bool SBCCallProfile::evaluate(ParamReplacerCtx& ctx,
833 833
   return true;
834 834
 }
835 835
 
836
+
837
+bool SBCCallProfile::evaluateOutboundInterface() {
838
+  REPLACE_IFACE_SIP(outbound_interface, outbound_interface_value);
839
+  return true;
840
+}
841
+
836 842
 bool SBCCallProfile::evaluateRTPRelayInterface() {
837 843
   EVALUATE_IFACE_RTP(rtprelay_interface, rtprelay_interface_value);
838 844
   return true;
... ...
@@ -228,6 +228,8 @@ struct SBCCallProfile
228 228
     
229 229
     bool evaluate(ParamReplacerCtx& ctx, const AmSipRequest& req);
230 230
 
231
+    bool evaluateOutboundInterface();
232
+
231 233
     bool readConfig(AmConfigReader &cfg);
232 234
     void infoPrint() const;
233 235
     bool operator==(const TranscoderSettings& rhs) const;
... ...
@@ -22,6 +22,8 @@
22 22
 #define DSM_SBC_PARAM_ADDCALLEE_NEXT_HOP_1ST_REQ "next_hop_1st_req"
23 23
 #define DSM_SBC_PARAM_ADDCALLEE_NEXT_HOP_PATCH_RURI "next_hop_patch_ruri"
24 24
 #define DSM_SBC_PARAM_ADDCALLEE_NEXT_HOP_FIXED      "next_hop_fixed"
25
+#define DSM_SBC_PARAM_ADDCALLEE_OUTBOUND_INTERFACE "outbound_interface"
26
+
25 27
 
26 28
 #define DSM_SBC_PARAM_ADDCALLEE_RTP_MODE       "rtp_mode"
27 29
 #define DSM_SBC_PARAM_ADDCALLEE_TRANSPARENT_DLG_ID "transparent_dlg_id"
... ...
@@ -208,8 +208,7 @@ sbc.addCallee(string mode, string varname)
208 208
          $varname.next_hop_fixed      - fixed next hop
209 209
 
210 210
          $varname.outbound_proxy - outbound proxy in new call
211
-         $varname.outbound_proxy - outbound proxy in new call
212
-         $varname.outbound_proxy - outbound proxy in new call
211
+         $varname.outbound_interface - outbound interface used for new call
213 212
 
214 213
          $varname.transparent_dlg_id - "yes" or "no": use transparent dlg IDs for new call; default no
215 214
                                         - "no" very much advised if current leg was connected before!