Browse code

sbc: allow custom AmSipSubscription instance to be passed in constructor

Raphael Coeffic authored on 17/06/2013 10:28:59
Showing 4 changed files
... ...
@@ -49,10 +49,11 @@ ReliableB2BEvent::~ReliableB2BEvent()
49 49
 ////////////////////////////////////////////////////////////////////////////////
50 50
 
51 51
 // callee
52
-CallLeg::CallLeg(const CallLeg* caller, AmSipDialog* p_dlg):
53
-  AmB2BSession(caller->getLocalTag(),p_dlg),
54
-  call_status(Disconnected),
55
-  hold_request_cseq(0), hold_status(NotHeld)
52
+CallLeg::CallLeg(const CallLeg* caller, AmSipDialog* p_dlg, AmSipSubscription* p_subs)
53
+  : AmB2BSession(caller->getLocalTag(),p_dlg,p_subs),
54
+    call_status(Disconnected),
55
+    hold_request_cseq(0), 
56
+    hold_status(NotHeld)
56 57
 {
57 58
   a_leg = !caller->a_leg; // we have to be the complement
58 59
 
... ...
@@ -92,10 +93,11 @@ CallLeg::CallLeg(const CallLeg* caller, AmSipDialog* p_dlg):
92 93
 }
93 94
 
94 95
 // caller
95
-CallLeg::CallLeg(AmSipDialog* p_dlg): 
96
-  AmB2BSession("",p_dlg),
97
-  call_status(Disconnected),
98
-  hold_request_cseq(0), hold_status(NotHeld)
96
+CallLeg::CallLeg(AmSipDialog* p_dlg, AmSipSubscription* p_subs)
97
+  : AmB2BSession("",p_dlg,p_subs),
98
+    call_status(Disconnected),
99
+    hold_request_cseq(0),
100
+    hold_status(NotHeld)
99 101
 {
100 102
   a_leg = true;
101 103
 
... ...
@@ -371,10 +371,11 @@ class CallLeg: public AmB2BSession
371 371
 
372 372
   public:
373 373
     /** creates A leg */
374
-    CallLeg(AmSipDialog* dlg=NULL);
374
+    CallLeg(AmSipDialog* p_dlg=NULL, AmSipSubscription* p_subs=NULL);
375 375
 
376 376
     /** creates B leg using given session as A leg */
377
-    CallLeg(const CallLeg* caller, AmSipDialog* dlg=NULL);
377
+    CallLeg(const CallLeg* caller, AmSipDialog* p_dlg=NULL,
378
+	    AmSipSubscription* p_subs=NULL);
378 379
 
379 380
     virtual ~CallLeg();
380 381
 };
... ...
@@ -152,8 +152,9 @@ void PayloadIdMapping::reset()
152 152
 ///////////////////////////////////////////////////////////////////////////////////////////
153 153
 
154 154
 // A leg constructor (from SBCDialog)
155
-SBCCallLeg::SBCCallLeg(const SBCCallProfile& call_profile, AmSipDialog* p_dlg)
156
-  : CallLeg(p_dlg),
155
+SBCCallLeg::SBCCallLeg(const SBCCallProfile& call_profile, AmSipDialog* p_dlg,
156
+		       AmSipSubscription* p_subs)
157
+  : CallLeg(p_dlg,p_subs),
157 158
     m_state(BB_Init),
158 159
     auth(NULL),
159 160
     call_profile(call_profile),
... ...
@@ -182,10 +183,11 @@ SBCCallLeg::SBCCallLeg(const SBCCallProfile& call_profile, AmSipDialog* p_dlg)
182 183
 }
183 184
 
184 185
 // B leg constructor (from SBCCalleeSession)
185
-SBCCallLeg::SBCCallLeg(SBCCallLeg* caller, AmSipDialog* p_dlg)
186
+SBCCallLeg::SBCCallLeg(SBCCallLeg* caller, AmSipDialog* p_dlg,
187
+		       AmSipSubscription* p_subs)
186 188
   : auth(NULL),
187 189
     call_profile(caller->getCallProfile()),
188
-    CallLeg(caller,p_dlg),
190
+    CallLeg(caller,p_dlg,p_subs),
189 191
     cc_started(false),
190 192
     logger(NULL)
191 193
 {
... ...
@@ -223,8 +225,8 @@ SBCCallLeg::SBCCallLeg(SBCCallLeg* caller, AmSipDialog* p_dlg)
223 225
   setLogger(caller->getLogger());
224 226
 }
225 227
 
226
-SBCCallLeg::SBCCallLeg(AmSipDialog* p_dlg)
227
-  : CallLeg(p_dlg),
228
+SBCCallLeg::SBCCallLeg(AmSipDialog* p_dlg, AmSipSubscription* p_subs)
229
+  : CallLeg(p_dlg,p_subs),
228 230
     m_state(BB_Init),
229 231
     auth(NULL),
230 232
     cc_timer_id(SBC_TIMER_ID_CALL_TIMERS_START),
... ...
@@ -114,9 +114,11 @@ class SBCCallLeg : public CallLeg, public CredentialHolder
114 114
 
115 115
  public:
116 116
 
117
-  SBCCallLeg(const SBCCallProfile& call_profile, AmSipDialog* dlg=NULL);
118
-  SBCCallLeg(SBCCallLeg* caller, AmSipDialog* dlg=NULL);
119
-  SBCCallLeg(AmSipDialog* dlg=NULL);
117
+  SBCCallLeg(const SBCCallProfile& call_profile, AmSipDialog* dlg=NULL,
118
+	     AmSipSubscription* p_subs=NULL);
119
+  SBCCallLeg(SBCCallLeg* caller, AmSipDialog* dlg=NULL,
120
+	     AmSipSubscription* p_subs=NULL);
121
+  SBCCallLeg(AmSipDialog* dlg=NULL,AmSipSubscription* p_subs=NULL);
120 122
   ~SBCCallLeg();
121 123
 
122 124
   void process(AmEvent* ev);