Browse code

sbc: allow starting timers from CC modules using extended interface

Václav Kubart authored on 10/04/2013 13:42:43 • Raphael Coeffic committed on 22/05/2013 19:50:17
Showing 2 changed files
... ...
@@ -151,6 +151,7 @@ SBCCallLeg::SBCCallLeg(const SBCCallProfile& call_profile, AmSipDialog* p_dlg)
151 151
     auth(NULL),
152 152
     call_profile(call_profile),
153 153
     cc_timer_id(SBC_TIMER_ID_CALL_TIMERS_START),
154
+    ext_cc_timer_id(SBC_TIMER_ID_CALL_TIMERS_END + 1),
154 155
     cc_started(false)
155 156
 {
156 157
   set_sip_relay_only(false);
... ...
@@ -36,6 +36,7 @@ class SBCCallLeg : public CallLeg, public CredentialHolder
36 36
 
37 37
   // current timer ID - cc module setting timer will use this
38 38
   int cc_timer_id;
39
+  int ext_cc_timer_id; // for assigning IDs to timers through "extended CC interface"
39 40
 
40 41
   struct timeval call_start_ts;
41 42
   struct timeval call_connect_ts;
... ...
@@ -168,6 +169,9 @@ class SBCCallLeg : public CallLeg, public CredentialHolder
168 169
   virtual void putOnHold();
169 170
   virtual void resumeHeld(bool send_reinvite);
170 171
 
172
+  // timers accessible from CC modules
173
+  int startTimer(double timeout) { setTimer(ext_cc_timer_id, timeout); return ext_cc_timer_id++; }
174
+
171 175
  protected:
172 176
 
173 177
   void setOtherId(const AmSipReply& reply);