Browse code

sbc:dsm: addCallee mode ltag - reconnect existing callee leg

Stefan Sayer authored on 11/11/2013 18:51:50
Showing 4 changed files
... ...
@@ -418,9 +418,9 @@ EXEC_ACTION_START(MODSBCActionAddCallee) {
418 418
   GET_SBC_CALL_LEG(sbc.addCallee);
419 419
 
420 420
   string mode = resolveVars(par1, sess, sc_sess, event_params);
421
+  string varname = par2;
421 422
 
422 423
   if (mode == DSM_SBC_PARAM_ADDCALLEE_MODE_STR) {
423
-    string varname = par2;
424 424
     string hdrs;
425 425
     SBCCallLeg* peer = new SBCCallLeg(sbc_call_leg);
426 426
     SBCCallProfile &p = peer->getCallProfile();
... ...
@@ -456,6 +456,19 @@ EXEC_ACTION_START(MODSBCActionAddCallee) {
456 456
     }
457 457
 
458 458
     sbc_call_leg->addCallee(peer, hdrs, rtp_mode);
459
+  } else if (mode == DSM_SBC_PARAM_ADDCALLEE_MODE_LTAG) {
460
+    string ltag;
461
+    string hdrs;
462
+
463
+    VarMapT::iterator it = sc_sess->var.find(varname+"." DSM_SBC_PARAM_ADDCALLEE_LTAG);
464
+    if (it != sc_sess->var.end())
465
+      ltag = it->second;
466
+
467
+    it = sc_sess->var.find(varname+"." DSM_SBC_PARAM_ADDCALLEE_HDRS);
468
+    if (it != sc_sess->var.end())
469
+      hdrs = it->second;
470
+
471
+    sbc_call_leg->addCallee(ltag, hdrs);
459 472
   }
460 473
 
461 474
 } EXEC_ACTION_END;
... ...
@@ -59,4 +59,5 @@ DEF_ACTION_2P(MODSBCResumeRtpStreams);
59 59
 
60 60
 DEF_ACTION_2P(MODSBCMuteRtpStreams);
61 61
 DEF_ACTION_2P(MODSBCUnmuteRtpStreams);
62
+
62 63
 #endif
... ...
@@ -12,11 +12,16 @@
12 12
 #define DSM_SBC_CCVAR_START_DIAG      "start_diag"
13 13
 
14 14
 #define DSM_SBC_PARAM_ADDCALLEE_MODE_STR "var"
15
+#define DSM_SBC_PARAM_ADDCALLEE_MODE_LTAG "ltag"
16
+
15 17
 #define DSM_SBC_PARAM_ADDCALLEE_LOCAL_PARTY  "local_party"
16 18
 #define DSM_SBC_PARAM_ADDCALLEE_REMOTE_PARTY "remote_party"
17 19
 #define DSM_SBC_PARAM_ADDCALLEE_HDRS           "hdrs"
18 20
 #define DSM_SBC_PARAM_ADDCALLEE_OUTBOUND_PROXY "outbound_proxy"
19 21
 #define DSM_SBC_PARAM_ADDCALLEE_RTP_MODE       "rtp_mode"
20 22
 
23
+#define DSM_SBC_PARAM_ADDCALLEE_LTAG           "ltag"
24
+
25
+
21 26
 #endif
22 27
 
... ...
@@ -205,6 +205,10 @@ sbc.addCallee(string mode, string varname)
205 205
            set($b.remote_party="sip:neu@192.168.5.110:5088");
206 206
            sbc.addCallee(var, b);
207 207
 
208
+  mode=="ltag"  - existing call referenced by ltag
209
+         $varname.ltag           - ltag of call to reconnect
210
+         $varname.hdrs           - headers in outgoing INVITE (optional)
211
+
208 212
 sbc.enableRelayDTMFReceiving(bool rcv_dtmf)  - enable receiving of RTP DTMF in relayed stream (RTP_Relay mode)
209 213
      note: session needs to be processed by media processor as well (sbc.addToMediaProcessor())
210 214
            so that DTMF is processed and passed up to the application (key event).