Browse code

- simplified session timer config - moved session timer config into session timer module.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1438 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Raphael Coeffic authored on 30/06/2009 14:16:05
Showing 12 changed files
... ...
@@ -44,7 +44,7 @@ AmDynInvokeFactory::AmDynInvokeFactory(const string& name)
44 44
 }
45 45
 
46 46
 AmSessionFactory::AmSessionFactory(const string& name)
47
-  : AmPluginFactory(name), mod_conf(AmConfig::defaultSessionTimerConfig)
47
+  : AmPluginFactory(name)
48 48
 {
49 49
 }
50 50
 
... ...
@@ -67,7 +67,7 @@ AmSession* AmSessionFactory::onRefer(const AmSipRequest& req,
67 67
 }
68 68
 
69 69
 int AmSessionFactory::configureModule(AmConfigReader& cfg) {
70
-  return mod_conf.readFromConfig(cfg);
70
+  return 0;//mod_conf.readFromConfig(cfg);
71 71
 }
72 72
 
73 73
 void AmSessionFactory::configureSession(AmSession* sess) {
... ...
@@ -32,6 +32,7 @@
32 32
 #include "AmThread.h"
33 33
 #include "AmSipMsg.h"
34 34
 #include "AmConfig.h"
35
+#include "AmConfigReader.h"
35 36
 #include "AmArg.h"
36 37
 #include "AmEventQueue.h"
37 38
 
... ...
@@ -119,8 +120,6 @@ class AmSessionEventHandlerFactory: public AmPluginFactory
119 120
 class AmSessionFactory: public AmPluginFactory
120 121
 {
121 122
 
122
-  AmSessionTimerConfig mod_conf;
123
-
124 123
  protected:
125 124
   /**
126 125
    * This reads the module configuration from 
... ...
@@ -75,8 +75,6 @@ Dtmf::InbandDetectorType
75 75
 AmConfig::DefaultDTMFDetector     = Dtmf::SEMSInternal;
76 76
 bool AmConfig::IgnoreSIGCHLD      = true;
77 77
 
78
-AmSessionTimerConfig AmConfig::defaultSessionTimerConfig;
79
-
80 78
 int AmConfig::setSIPPort(const string& port) 
81 79
 {
82 80
   if(sscanf(port.c_str(),"%u",&AmConfig::LocalSIPPort) != 1) {
... ...
@@ -368,7 +366,7 @@ int AmConfig::readConfiguration()
368 366
     }
369 367
   }
370 368
 
371
-  return defaultSessionTimerConfig.readFromConfig(cfg);
369
+  return 0;
372 370
 }	
373 371
 
374 372
 int AmConfig::init()
... ...
@@ -376,68 +374,3 @@ int AmConfig::init()
376 374
   return 0;
377 375
 }
378 376
 
379
-AmSessionTimerConfig::AmSessionTimerConfig()
380
-  : EnableSessionTimer(DEFAULT_ENABLE_SESSION_TIMER), 
381
-    SessionExpires(SESSION_EXPIRES), 
382
-    MinimumTimer(MINIMUM_TIMER)
383
-{
384
-
385
-}
386
-AmSessionTimerConfig::~AmSessionTimerConfig() 
387
-{
388
-}
389
-
390
-int AmSessionTimerConfig::readFromConfig(AmConfigReader& cfg)
391
-{
392
-  // enable_session_timer
393
-  if(cfg.hasParameter("enable_session_timer")){
394
-    if(!setEnableSessionTimer(cfg.getParameter("enable_session_timer"))){
395
-      ERROR("invalid enable_session_timer specified\n");
396
-      return -1;
397
-    }
398
-  }
399
-
400
-  // session_expires
401
-  if(cfg.hasParameter("session_expires")){
402
-    if(!setSessionExpires(cfg.getParameter("session_expires"))){
403
-      ERROR("invalid session_expires specified\n");
404
-      return -1;
405
-    }
406
-  }
407
-
408
-  // minimum_timer
409
-  if(cfg.hasParameter("minimum_timer")){
410
-    if(!setMinimumTimer(cfg.getParameter("minimum_timer"))){
411
-      ERROR("invalid minimum_timer specified\n");
412
-      return -1;
413
-    }
414
-  }
415
-  return 0;
416
-}
417
-
418
-int AmSessionTimerConfig::setEnableSessionTimer(const string& enable) {
419
-  if ( strcasecmp(enable.c_str(), "yes") == 0 ) {
420
-    EnableSessionTimer = 1;
421
-  } else if ( strcasecmp(enable.c_str(), "no") == 0 ) {
422
-    EnableSessionTimer = 0;
423
-  } else {
424
-    return 0;
425
-  }	
426
-  return 1;
427
-}		
428
-
429
-int AmSessionTimerConfig::setSessionExpires(const string& se) {
430
-  if(sscanf(se.c_str(),"%u",&SessionExpires) != 1) {
431
-    return 0;
432
-  }
433
-  DBG("setSessionExpires(%i)\n",SessionExpires);
434
-  return 1;
435
-} 
436
-
437
-int AmSessionTimerConfig::setMinimumTimer(const string& minse) {
438
-  if(sscanf(minse.c_str(),"%u",&MinimumTimer) != 1) {
439
-    return 0;
440
-  }
441
-  DBG("setMinimumTimer(%i)\n",MinimumTimer);
442
-  return 1;
443
-}
... ...
@@ -38,7 +38,6 @@ using std::string;
38 38
 #include <sys/types.h>
39 39
 #include <regex.h>
40 40
 
41
-class AmSessionTimerConfig;
42 41
 
43 42
 /**
44 43
  * \brief holds the current configuration.
... ...
@@ -76,8 +75,6 @@ struct AmConfig
76 75
   static int RtpLowPort;
77 76
   /** Highest local RTP port */
78 77
   static int RtpHighPort;
79
-  /* Session Timer: */
80
-  static AmSessionTimerConfig defaultSessionTimerConfig;
81 78
   /** number of session scheduler threads */
82 79
   static int MediaProcessorThreads;
83 80
   /** the interface SIP requests are sent from - needed for registrar_client */
... ...
@@ -156,38 +153,6 @@ struct AmConfig
156 153
   static int setDeadRtpTime(const string& drt);
157 154
 };
158 155
 
159
-class AmConfigReader;
160
-/** \brief config for the session timer */
161
-class AmSessionTimerConfig {
162
-  /** Session Timer: enable? */
163
-  int EnableSessionTimer;
164
-  /** Session Timer: Desired Session-Expires */
165
-  unsigned int SessionExpires;
166
-  /** Session Timer: Minimum Session-Expires */
167
-  unsigned int MinimumTimer;
168
-    
169
-public:
170
-  AmSessionTimerConfig();
171
-  ~AmSessionTimerConfig();
172
-  
173
-
174
-  /** Session Timer: Enable Session Timer?
175
-      returns 0 on invalid value */
176
-  int setEnableSessionTimer(const string& enable);
177
-  /** Session Timer: Setter for Desired Session-Expires, 
178
-      returns 0 on invalid value */
179
-  int setSessionExpires(const string& se);
180
-  /** Session Timer: Setter for Minimum Session-Expires, 
181
-      returns 0 on invalid value */
182
-  int setMinimumTimer(const string& minse);
183
-
184
-  bool getEnableSessionTimer() { return EnableSessionTimer; }
185
-  unsigned int getSessionExpires() { return SessionExpires; }
186
-  unsigned int getMinimumTimer() { return MinimumTimer; }
187
-
188
-  int readFromConfig(AmConfigReader& cfg);
189
-};
190
-
191 156
 #endif
192 157
 
193 158
 // Local Variables:
... ...
@@ -76,7 +76,7 @@ int  AmConfigReader::loadFile(const string& path)
76 76
 	if (fname.length() && fname[0] != '/')
77 77
 	  fname = AmConfig::ModConfigPath + fname;
78 78
 	if(loadFile(fname))
79
-	    return -1;
79
+	    goto error;
80 80
 	continue;
81 81
     }
82 82
 
... ...
@@ -139,6 +139,7 @@ int  AmConfigReader::loadFile(const string& path)
139 139
 
140 140
  syntax_error:
141 141
   ERROR("syntax error line %i in %s\n",lc,path.c_str());
142
+ error:
142 143
   fclose(fp);
143 144
   return -1;
144 145
 }
... ...
@@ -28,6 +28,11 @@
28 28
 #include "AmSessionEventHandler.h"
29 29
 
30 30
 // AmSessionEventHandler methods
31
+int AmSessionEventHandler::configure(AmConfigReader& conf)
32
+{
33
+  return 0;
34
+}
35
+
31 36
 bool AmSessionEventHandler::process(AmEvent*)
32 37
 {
33 38
   return false;
... ...
@@ -32,6 +32,9 @@
32 32
 #include "AmSipEvent.h"
33 33
 #include <string>
34 34
 using std::string;
35
+
36
+class AmConfigReader;
37
+
35 38
 /**
36 39
  * \brief Interface for SIP signaling plugins that
37 40
  *        change requests or replies using hooks (ex: session timer).
... ...
@@ -52,6 +55,10 @@ public:
52 55
     : destroy(true) {}
53 56
 
54 57
   virtual ~AmSessionEventHandler() {}
58
+
59
+  /** Returns -1 on error, 0 else. */
60
+  virtual int configure(AmConfigReader& conf);
61
+
55 62
   /* 
56 63
    * All the methods return true if the event processing 
57 64
    * shall be stopped after them.
... ...
@@ -29,6 +29,7 @@
29 29
 #include "AmSession.h"
30 30
 #include "AmConfig.h"
31 31
 #include "AmAudio.h"
32
+#include "AmConfigReader.h"
32 33
 #include "log.h"
33 34
 
34 35
 #include "Echo.h"
... ...
@@ -47,17 +48,46 @@ EchoFactory::EchoFactory(const string& _app_name)
47 48
 
48 49
 int EchoFactory::onLoad()
49 50
 {
50
-  session_timer_f = AmPlugIn::instance()->getFactory4Seh("session_timer");
51
-  if (NULL == session_timer_f) {
52
-    ERROR("load session_timer module for echo application.\n");
51
+  bool useSessionTimer = false;
52
+    
53
+  if(conf.loadFile(AmConfig::ModConfigPath + string(MODULE_NAME)+ ".conf")){
54
+    WARN("Could not open " MODULE_NAME ".conf\n");
55
+    WARN("assuming that default values are fine\n");
53 56
   }
54
-  return (session_timer_f == NULL);
57
+  else {
58
+    if(conf.hasParameter("enable_session_timer") &&
59
+       (conf.getParameter("enable_session_timer") == string("yes")) ){
60
+      
61
+      useSessionTimer = true;
62
+    }
63
+  }
64
+  
65
+  if(useSessionTimer){
66
+    session_timer_f = AmPlugIn::instance()->getFactory4Seh("session_timer");
67
+    DBG("session_timer_f == 0x%.16lX\n",(unsigned long)session_timer_f);
68
+    if(session_timer_f == NULL){
69
+      ERROR("Could not load the session_timer module: switch it off\n");
70
+      //return -1;
71
+    }
72
+  }
73
+  
74
+  return 0;
55 75
 }
56 76
 
57 77
 AmSession* EchoFactory::onInvite(const AmSipRequest& req)
58 78
 {
59 79
   AmSession* s = new EchoDialog();
60
-  s->addHandler(session_timer_f->getHandler(s));
80
+  
81
+  AmSessionEventHandler* h = session_timer_f->getHandler(s);
82
+
83
+  if(h->configure(conf)){
84
+    
85
+    ERROR("Could not configure the session timer: switch it off.\n");
86
+    delete h;
87
+  }
88
+  else {
89
+    s->addHandler(h);
90
+  }
61 91
 
62 92
   return s;
63 93
 }
... ...
@@ -38,6 +38,7 @@ using std::string;
38 38
 class EchoFactory: public AmSessionFactory
39 39
 {
40 40
   AmSessionEventHandlerFactory* session_timer_f;
41
+  AmConfigReader conf;
41 42
 
42 43
 public:
43 44
   EchoFactory(const string& _app_name);
... ...
@@ -59,6 +60,9 @@ public:
59 60
   void onDtmf(int event, int duration);
60 61
 };
61 62
 
63
+
64
+#define MODULE_NAME "echo"
65
+
62 66
 #endif
63 67
 // Local Variables:
64 68
 // mode:C++
... ...
@@ -99,9 +99,9 @@ bool SessionTimer::onSendRequest(const string& method,
99 99
   if  ((method != "INVITE") && (method != "UPDATE"))
100 100
     goto end;
101 101
   
102
-  m_hdrs += "Session-Expires: "+ int2str(session_timer_conf.getSessionExpires()) +CRLF
103
-    + "Min-SE: " + int2str(session_timer_conf.getMinimumTimer()) + CRLF;
104
-
102
+  m_hdrs += "Session-Expires: "+ int2str(session_interval) +CRLF
103
+    + "Min-SE: " + int2str(min_se) + CRLF;
104
+  
105 105
  end:
106 106
   hdrs += m_hdrs;
107 107
   return false;
... ...
@@ -114,9 +114,6 @@ bool SessionTimer::onSendReply(const AmSipRequest& req,
114 114
 			       string& hdrs,
115 115
 			       int flags)
116 116
 {
117
-  //if (!session_timer_conf.getEnableSessionTimer())
118
-  // 	return "";
119
-
120 117
   string m_hdrs = SIP_HDR_COLSP(SIP_HDR_SUPPORTED)  "timer"  CRLF;
121 118
   if  ((req.method != "INVITE") && (req.method != "UPDATE")) 
122 119
     return false;
... ...
@@ -136,14 +133,21 @@ bool SessionTimer::onSendReply(const AmSipRequest& req,
136 133
 
137 134
 
138 135
 /* Session Timer: -ssa */
139
-void SessionTimer::configureSessionTimer(const AmSessionTimerConfig& conf) 
136
+int  SessionTimer::configure(AmConfigReader& conf) 
140 137
 {
141
-  session_timer_conf = conf;
138
+  if(session_timer_conf.readFromConfig(conf))
139
+    return -1;
140
+
141
+  session_interval = session_timer_conf.getSessionExpires();
142
+  min_se = session_timer_conf.getMinimumTimer();
143
+
142 144
   DBG("Configured session with EnableSessionTimer = %s, SessionExpires = %u, MinimumTimer = %u\n", 
143 145
       session_timer_conf.getEnableSessionTimer() ? "yes":"no", 
144 146
       session_timer_conf.getSessionExpires(),
145 147
       session_timer_conf.getMinimumTimer()
146 148
       );
149
+
150
+  return 0;
147 151
 }
148 152
 
149 153
 /** 
... ...
@@ -153,15 +157,14 @@ void SessionTimer::configureSessionTimer(const AmSessionTimerConfig& conf)
153 157
  */
154 158
 bool SessionTimerFactory::checkSessionExpires(const AmSipRequest& req) 
155 159
 {
156
-  //if (session_timer_conf.getEnableSessionTimer()) {
157 160
   string session_expires = getHeader(req.hdrs, "Session-Expires", "x");
158 161
 
159 162
   if (session_expires.length()) {
160 163
     unsigned int i_se;
161 164
     if (!str2i(strip_header_params(session_expires), i_se)) {
165
+
162 166
       //if (i_se < session_timer_conf.getMinimumTimer()) {
163
-      //TODO: reply_error...
164
-      //throw SessionTimerException(session_timer_conf.getMinimumTimer());
167
+      //TODO: reply 422...
165 168
       //}
166 169
     } else
167 170
       throw AmSession::Exception(500,"internal error"); // malformed request?
... ...
@@ -181,20 +184,17 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipRequest& req) {
181 184
     // determine session interval
182 185
     string sess_expires_hdr = getHeader(req.hdrs, "Session-Expires", "x");
183 186
     
184
-    //session_interval = get_session_interval_from(req);
187
+    unsigned int rem_sess_expires=0; 
185 188
     if (!sess_expires_hdr.empty()) {
186 189
       if (str2i(strip_header_params(sess_expires_hdr),
187
-		session_interval)) {
190
+		rem_sess_expires)) {
188 191
 	WARN("error while parsing Session-Expires header value '%s'\n", 
189 192
 	     strip_header_params(sess_expires_hdr).c_str()); // exception?
190
-	session_interval = session_timer_conf.getSessionExpires();  
191 193
       }
192
-    } else {
193
-      session_interval = session_timer_conf.getSessionExpires();  
194 194
     }
195 195
 
196 196
     // get Min-SE
197
-    unsigned int i_minse = session_timer_conf.getMinimumTimer();
197
+    unsigned int i_minse = min_se;
198 198
     string min_se_hdr = getHeader(req.hdrs, "Min-SE");
199 199
     if (!min_se_hdr.empty()) {
200 200
       if (str2i(strip_header_params(min_se_hdr),
... ...
@@ -205,15 +205,15 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipRequest& req) {
205 205
     }
206 206
 
207 207
     // calculate actual se
208
-    unsigned int min = session_timer_conf.getMinimumTimer();
209
-    if (i_minse > min)
210
-      min = i_minse;
211
-    if ((session_timer_conf.getSessionExpires() < min)||
212
-	(session_interval<min)) {
213
-      session_interval = min;
208
+
209
+    if (i_minse > min_se)
210
+      min_se = i_minse;
211
+
212
+    if (rem_sess_expires < min_se) {
213
+      session_interval = min_se;
214 214
     } else {
215
-      if (session_timer_conf.getSessionExpires() < session_interval)
216
-	session_interval = session_timer_conf.getSessionExpires();
215
+      if (rem_sess_expires < session_interval)
216
+	session_interval = rem_sess_expires;
217 217
     }
218 218
      
219 219
     // determine session refresher -- cf rfc4028 Table 2
... ...
@@ -254,12 +254,10 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipReply& reply)
254 254
   if (sess_expires_hdr.empty())
255 255
     sess_expires_hdr = getHeader(reply.hdrs, "x"); // compact form
256 256
   
257
-  session_interval = session_timer_conf.getSessionExpires();
258 257
   session_refresher = refresh_local;
259 258
   session_refresher_role = UAC;
260 259
   
261 260
   if (!sess_expires_hdr.empty()) {
262
-    //session_interval = get_session_interval_from(req);
263 261
     unsigned int sess_i_tmp = 0;
264 262
     if (str2i(strip_header_params(sess_expires_hdr),
265 263
 	      sess_i_tmp)) {
... ...
@@ -267,8 +265,8 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipReply& reply)
267 265
 	   strip_header_params(sess_expires_hdr).c_str()); // exception?
268 266
     } else {
269 267
       // this is forbidden by rfc, but to be sure against 'rogue' proxy/uas
270
-      if (sess_i_tmp < session_timer_conf.getMinimumTimer()) {
271
-	session_interval = session_timer_conf.getMinimumTimer();
268
+      if (sess_i_tmp < min_se) {
269
+	session_interval = min_se;
272 270
       } else {
273 271
 	session_interval = sess_i_tmp;
274 272
       }
... ...
@@ -281,7 +279,6 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipReply& reply)
281 279
   
282 280
   removeTimers(s);
283 281
   setTimers(s);
284
-
285 282
 }
286 283
 
287 284
 void SessionTimer::setTimers(AmSession* s) 
... ...
@@ -334,3 +331,68 @@ void SessionTimer::onTimeoutEvent(AmTimeoutEvent* timeout_ev)
334 331
   return;
335 332
 }
336 333
 
334
+AmSessionTimerConfig::AmSessionTimerConfig()
335
+  : EnableSessionTimer(DEFAULT_ENABLE_SESSION_TIMER), 
336
+    SessionExpires(SESSION_EXPIRES), 
337
+    MinimumTimer(MINIMUM_TIMER)
338
+{
339
+
340
+}
341
+AmSessionTimerConfig::~AmSessionTimerConfig() 
342
+{
343
+}
344
+
345
+int AmSessionTimerConfig::readFromConfig(AmConfigReader& cfg)
346
+{
347
+  // enable_session_timer
348
+  if(cfg.hasParameter("enable_session_timer")){
349
+    if(!setEnableSessionTimer(cfg.getParameter("enable_session_timer"))){
350
+      ERROR("invalid enable_session_timer specified\n");
351
+      return -1;
352
+    }
353
+  }
354
+
355
+  // session_expires
356
+  if(cfg.hasParameter("session_expires")){
357
+    if(!setSessionExpires(cfg.getParameter("session_expires"))){
358
+      ERROR("invalid session_expires specified\n");
359
+      return -1;
360
+    }
361
+  }
362
+
363
+  // minimum_timer
364
+  if(cfg.hasParameter("minimum_timer")){
365
+    if(!setMinimumTimer(cfg.getParameter("minimum_timer"))){
366
+      ERROR("invalid minimum_timer specified\n");
367
+      return -1;
368
+    }
369
+  }
370
+  return 0;
371
+}
372
+
373
+int AmSessionTimerConfig::setEnableSessionTimer(const string& enable) {
374
+  if ( strcasecmp(enable.c_str(), "yes") == 0 ) {
375
+    EnableSessionTimer = 1;
376
+  } else if ( strcasecmp(enable.c_str(), "no") == 0 ) {
377
+    EnableSessionTimer = 0;
378
+  } else {
379
+    return 0;
380
+  }	
381
+  return 1;
382
+}		
383
+
384
+int AmSessionTimerConfig::setSessionExpires(const string& se) {
385
+  if(sscanf(se.c_str(),"%u",&SessionExpires) != 1) {
386
+    return 0;
387
+  }
388
+  DBG("setSessionExpires(%i)\n",SessionExpires);
389
+  return 1;
390
+} 
391
+
392
+int AmSessionTimerConfig::setMinimumTimer(const string& minse) {
393
+  if(sscanf(minse.c_str(),"%u",&MinimumTimer) != 1) {
394
+    return 0;
395
+  }
396
+  DBG("setMinimumTimer(%i)\n",MinimumTimer);
397
+  return 1;
398
+}
... ...
@@ -40,6 +40,12 @@ class AmTimeoutEvent;
40 40
 #define ID_SESSION_INTERVAL_TIMER -1
41 41
 #define ID_SESSION_REFRESH_TIMER  -2
42 42
 
43
+/* Session Timer defaul configuration: */
44
+#define DEFAULT_ENABLE_SESSION_TIMER 1
45
+#define SESSION_EXPIRES              120  // seconds
46
+#define MINIMUM_TIMER                90   //seconds
47
+
48
+
43 49
 /** \brief Factory of the session timer event handler */
44 50
 class SessionTimerFactory: public AmSessionEventHandlerFactory
45 51
 {
... ...
@@ -55,9 +61,43 @@ class SessionTimerFactory: public AmSessionEventHandlerFactory
55 61
   AmSessionEventHandler* getHandler(AmSession* s);
56 62
 };
57 63
 
64
+/** \brief config for the session timer */
65
+class AmSessionTimerConfig 
66
+{
67
+
68
+  /** Session Timer: enable? */
69
+  int EnableSessionTimer;
70
+  /** Session Timer: Desired Session-Expires */
71
+  unsigned int SessionExpires;
72
+  /** Session Timer: Minimum Session-Expires */
73
+  unsigned int MinimumTimer;
74
+    
75
+public:
76
+  AmSessionTimerConfig();
77
+  ~AmSessionTimerConfig();
78
+  
79
+
80
+  /** Session Timer: Enable Session Timer?
81
+      returns 0 on invalid value */
82
+  int setEnableSessionTimer(const string& enable);
83
+  /** Session Timer: Setter for Desired Session-Expires, 
84
+      returns 0 on invalid value */
85
+  int setSessionExpires(const string& se);
86
+  /** Session Timer: Setter for Minimum Session-Expires, 
87
+      returns 0 on invalid value */
88
+  int setMinimumTimer(const string& minse);
89
+
90
+  bool getEnableSessionTimer() { return EnableSessionTimer; }
91
+  unsigned int getSessionExpires() { return SessionExpires; }
92
+  unsigned int getMinimumTimer() { return MinimumTimer; }
93
+
94
+  int readFromConfig(AmConfigReader& cfg);
95
+};
96
+
58 97
 /** \brief SessionEventHandler for implementing session timer logic for a session */
59 98
 class SessionTimer: public AmSessionEventHandler
60 99
 {
100
+  AmSessionTimerConfig session_timer_conf;
61 101
   AmSession* s;
62 102
 
63 103
   enum SessionRefresher {
... ...
@@ -69,10 +109,8 @@ class SessionTimer: public AmSessionEventHandler
69 109
     UAS
70 110
   };
71 111
 
72
-  void configureSessionTimer(const AmSessionTimerConfig& conf);
73
-  AmSessionTimerConfig session_timer_conf;
74
-
75 112
   bool                 remote_timer_aware;
113
+  unsigned int         min_se;
76 114
   unsigned int         session_interval;  
77 115
   SessionRefresher     session_refresher;
78 116
   SessionRefresherRole session_refresher_role;
... ...
@@ -97,6 +135,7 @@ class SessionTimer: public AmSessionEventHandler
97 135
   virtual ~SessionTimer(){}
98 136
 
99 137
   /* @see AmSessionEventHandler */
138
+  virtual int  configure(AmConfigReader& conf); 
100 139
   virtual bool process(AmEvent*);
101 140
   virtual bool onSipEvent(AmSipEvent*);
102 141
   virtual bool onSipRequest(const AmSipRequest&);
... ...
@@ -54,11 +54,6 @@
54 54
 // session considered dead after 5 minutes no RTP
55 55
 #define DEAD_RTP_TIME       5*60  
56 56
 
57
-/* Session Timer defaul configuration: */
58
-#define DEFAULT_ENABLE_SESSION_TIMER 1
59
-#define SESSION_EXPIRES              60 // seconds
60
-#define MINIMUM_TIMER                5   //seconds
61
-
62 57
 #define NUM_MEDIA_PROCESSORS 1
63 58
 
64 59
 #define MAX_NET_DEVICES     32