Browse code

make AmSipDialog::oa and AmSipDialog::100rel private

Stefan Sayer authored on 07/02/2012 15:43:29
Showing 4 changed files
... ...
@@ -551,7 +551,7 @@ SBCDialog::SBCDialog(const SBCCallProfile& call_profile)
551 551
     cc_timer_id(SBC_TIMER_ID_CALL_TIMERS_START)
552 552
 {
553 553
   set_sip_relay_only(false);
554
-  dlg.rel100.setState(Am100rel::REL100_IGNORED);
554
+  dlg.setRel100State(Am100rel::REL100_IGNORED);
555 555
 
556 556
   memset(&call_connect_ts, 0, sizeof(struct timeval));
557 557
   memset(&call_end_ts, 0, sizeof(struct timeval));
... ...
@@ -1583,7 +1583,7 @@ SBCCalleeSession::SBCCalleeSession(const AmB2BCallerSession* caller,
1583 1583
     call_profile(call_profile),
1584 1584
     AmB2BCalleeSession(caller)
1585 1585
 {
1586
-  dlg.rel100.setState(Am100rel::REL100_IGNORED);
1586
+  dlg.setRel100State(Am100rel::REL100_IGNORED);
1587 1587
 
1588 1588
   if (call_profile.sdpfilter_enabled) {
1589 1589
     b2b_mode = B2BMode_SDPFilter;
... ...
@@ -230,6 +230,19 @@ bool AmSipDialog::getSdpAnswer(const AmSdp& offer, AmSdp& answer)
230 230
   return hdl->getSdpAnswer(offer,answer);
231 231
 }
232 232
 
233
+AmOfferAnswer::OAState AmSipDialog::getOAState() {
234
+  return oa.getState();
235
+}
236
+
237
+void AmSipDialog::setOAState(AmOfferAnswer::OAState n_st) {
238
+  oa.setState(n_st);
239
+}
240
+
241
+void AmSipDialog::setRel100State(Am100rel::State rel100_state) {
242
+  DBG("setting 100rel state for '%s' to %i\n", local_tag.c_str(), rel100_state);
243
+  rel100.setState(rel100_state);
244
+}
245
+
233 246
 /**
234 247
  * Update dialog status from UAC Request that we send (e.g. INVITE)
235 248
  * (called only from AmSessionContainer)
... ...
@@ -122,6 +122,12 @@ private:
122 122
 		  int flags,
123 123
 		  unsigned int req_cseq);
124 124
 
125
+  // Current offer/answer transaction
126
+  AmOfferAnswer oa;
127
+
128
+  // Reliable provisional reply support
129
+  Am100rel rel100;
130
+
125 131
  public:
126 132
   string user;         // local user
127 133
   string domain;       // local domain
... ...
@@ -153,12 +159,6 @@ private:
153 159
   bool r_cseq_i;
154 160
   unsigned int r_cseq; // last remote CSeq  
155 161
 
156
-  // Current offer/answer transaction
157
-  AmOfferAnswer oa;
158
-
159
-  // Reliable provisional reply support
160
-  Am100rel rel100;
161
-
162 162
   AmSipDialog(AmSipDialogEventHandler* h);
163 163
   ~AmSipDialog();
164 164
 
... ...
@@ -213,8 +213,13 @@ private:
213 213
   bool getSdpOffer(AmSdp& offer);
214 214
   bool getSdpAnswer(const AmSdp& offer, AmSdp& answer);
215 215
 
216
+  AmOfferAnswer::OAState getOAState();
217
+  void setOAState(AmOfferAnswer::OAState n_st);
218
+
219
+  void setRel100State(Am100rel::State rel100_state);
220
+
216 221
   void uasTimeout(AmSipTimeoutEvent* to_ev);
217
-    
222
+
218 223
   /** @return 0 on success (deprecated) */
219 224
   int reply(const AmSipRequest& req,
220 225
 	    unsigned int  code, 
... ...
@@ -194,7 +194,7 @@ bool UACAuth::onSipReply(const AmSipReply& reply, AmSipDialog::Status old_dlg_st
194 194
 	    }
195 195
 
196 196
 	    // reset OA state to what is was before sending the failed request
197
-	    dlg->oa.setState(ri->second.oa_state);
197
+	    dlg->setOAState(ri->second.oa_state);
198 198
 
199 199
 	    // resend request 
200 200
 	    if (dlg->sendRequest(ri->second.method,
... ...
@@ -250,7 +250,7 @@ bool UACAuth::onSendRequest(const string& method,
250 250
 				       content_type,
251 251
 				       body,
252 252
 				       hdrs,
253
-				       dlg->oa.getState());
253
+				       dlg->getOAState());
254 254
   return false;
255 255
 }
256 256