Browse code

b/f:sbc:dsm: sbc.addCallee for new call with non-transparent dlg id

Stefan Sayer authored on 21/11/2013 15:28:49
Showing 3 changed files
... ...
@@ -423,11 +423,24 @@ EXEC_ACTION_START(MODSBCActionAddCallee) {
423 423
 
424 424
   if (mode == DSM_SBC_PARAM_ADDCALLEE_MODE_STR) {
425 425
     string hdrs;
426
+
427
+    VarMapT::iterator it = sc_sess->var.find(varname+"." DSM_SBC_PARAM_ADDCALLEE_TRANSPARENT_DLG_ID);
428
+    if (it != sc_sess->var.end()) {
429
+      sbc_call_leg->getCallProfile().transparent_dlg_id = it->second == DSM_TRUE;
430
+    } else {
431
+      // default to false
432
+      sbc_call_leg->getCallProfile().transparent_dlg_id = false;
433
+    }
434
+
435
+      DBG("Using %stransparent dialog IDs for new call leg\n",
436
+	  sbc_call_leg->getCallProfile().transparent_dlg_id ? "":"non-");
437
+
426 438
     SBCCallLeg* peer = new SBCCallLeg(sbc_call_leg);
439
+
427 440
     SBCCallProfile &p = peer->getCallProfile();
428 441
     AmB2BSession::RTPRelayMode rtp_mode = sbc_call_leg->getRtpRelayMode();
429 442
 
430
-    VarMapT::iterator it = sc_sess->var.find(varname+"." DSM_SBC_PARAM_ADDCALLEE_LOCAL_PARTY);
443
+    it = sc_sess->var.find(varname+"." DSM_SBC_PARAM_ADDCALLEE_LOCAL_PARTY);
431 444
     if (it != sc_sess->var.end())
432 445
       peer->setLocalParty(it->second, it->second);
433 446
 
... ...
@@ -19,6 +19,7 @@
19 19
 #define DSM_SBC_PARAM_ADDCALLEE_HDRS           "hdrs"
20 20
 #define DSM_SBC_PARAM_ADDCALLEE_OUTBOUND_PROXY "outbound_proxy"
21 21
 #define DSM_SBC_PARAM_ADDCALLEE_RTP_MODE       "rtp_mode"
22
+#define DSM_SBC_PARAM_ADDCALLEE_TRANSPARENT_DLG_ID "transparent_dlg_id"
22 23
 
23 24
 #define DSM_SBC_PARAM_ADDCALLEE_LTAG           "ltag"
24 25
 
... ...
@@ -200,6 +200,11 @@ sbc.addCallee(string mode, string varname)
200 200
          $varname.remote_party   - remote party (To) in new call
201 201
          $varname.hdrs           - headers in outgoing INVITE
202 202
          $varname.outbound_proxy - outbound proxy in new call
203
+         $varname.transparent_dlg_id - "yes" or "no": use transparent dlg IDs for new call; default no
204
+                                        - "no" very much advised if current leg was connected before!
205
+                                          otherwise local tag in current leg will be overwritten on reply
206
+                                          in other leg
207
+
203 208
      e.g.  set($b.local_party="sip:ftb@192.168.5.110:5080");
204 209
            set($b.remote_party="sip:neu@192.168.5.110:5088");
205 210
            sbc.addCallee(var, b);