Module: sems
Branch: master
Commit: c46cb728cbb64844be078faf94e6efb7dad5b6cd
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=c46cb728cbb64844be078faf94e6efb7dad5b6cd

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Nov 24 13:11:37 2011 +0100

removed references to deprecated timersSupported, cleaned up some

---

 apps/annrecorder/AnnRecorder.cpp          |    6 ------
 apps/callback/CallBack.cpp                |    2 +-
 apps/examples/b2b_connect/b2b_connect.cpp |    6 ------
 apps/examples/call_gen/CallGen.cpp        |    2 +-
 apps/examples/tutorial/mycc/MyCC.cpp      |    4 ----
 apps/ivr/Ivr.cpp                          |    5 -----
 apps/py_sems/PySems.cpp                   |   10 ----------
 apps/sbc/SBC.cpp                          |    6 ------
 apps/voicemail/AnswerMachine.cpp          |    5 -----
 core/AmSession.cpp                        |   21 ++++-----------------
 core/AmSession.h                          |    8 ++------
 doc/dsm/dsm_syntax.txt                    |    2 +-
 12 files changed, 9 insertions(+), 68 deletions(-)

diff --git a/apps/annrecorder/AnnRecorder.cpp b/apps/annrecorder/AnnRecorder.cpp
index 4979440..14ee761 100644
--- a/apps/annrecorder/AnnRecorder.cpp
+++ b/apps/annrecorder/AnnRecorder.cpp
@@ -104,12 +104,6 @@ int AnnRecorderFactory::onLoad()
   AM_PROMPT_ADD(BEEP, ANNREC_ANNOUNCE_PATH BEEP".wav");
   AM_PROMPT_END(prompts, cfg, MOD_NAME);
 
-
-  if (!AmSession::timersSupported()) {
-    ERROR("sorry, could not load user_timer from session_timer plug-in\n");
-    return -1;
-  }
-
   message_storage_fact = AmPlugIn::instance()->getFactory4Di("msg_storage");
   if(!message_storage_fact) {
     ERROR("sorry, could not get msg_storage, please load a suitable 
plug-in\n");
diff --git a/apps/callback/CallBack.cpp b/apps/callback/CallBack.cpp
index b4051c6..f551755 100644
--- a/apps/callback/CallBack.cpp
+++ b/apps/callback/CallBack.cpp
@@ -172,7 +172,7 @@ AmSession* CallBackFactory::onInvite(const AmSipRequest& 
req, const string& app_
   return s;
 }
 
-// this could have been made easier with a user_timer. 
+// this could have been made easier with a timer... 
 void CallBackFactory::run() {
   DBG("running CallBack thread.\n");
   while (true) {
diff --git a/apps/examples/b2b_connect/b2b_connect.cpp 
b/apps/examples/b2b_connect/b2b_connect.cpp
index df172e8..9ca0733 100644
--- a/apps/examples/b2b_connect/b2b_connect.cpp
+++ b/apps/examples/b2b_connect/b2b_connect.cpp
@@ -38,7 +38,6 @@ EXPORT_SESSION_FACTORY(b2b_connectFactory,MOD_NAME);
 
 b2b_connectFactory::b2b_connectFactory(const string& _app_name)
 : AmSessionFactory(_app_name)
-// , user_timer_fact(NULL)
 {
 }
 
@@ -58,11 +57,6 @@ int b2b_connectFactory::onLoad()
   if (cfg.getParameter("transparent_ruri")=="true")
     TransparentDestination = true;
   
-//   if (!AmSession::timersSupported()) {
-//     ERROR("load session_timer plug-in for timers\n");
-//     return -1;
-//   }
-
   return 0;
 }
 
diff --git a/apps/examples/call_gen/CallGen.cpp 
b/apps/examples/call_gen/CallGen.cpp
index b325aa6..3e65d0e 100644
--- a/apps/examples/call_gen/CallGen.cpp
+++ b/apps/examples/call_gen/CallGen.cpp
@@ -407,7 +407,7 @@ void CallGenDialog::setCallTimer() {
   if (call_timer > 0) {
     DBG("setting timer %d %d\n", CALL_TIMER, call_timer);
     if (!setTimer(CALL_TIMER, call_timer)) {
-      ERROR("could not load user_timer from session_timer plug-in\n");
+      ERROR("internal: setting timer!\n");
       return;
     }
   }
diff --git a/apps/examples/tutorial/mycc/MyCC.cpp 
b/apps/examples/tutorial/mycc/MyCC.cpp
index 0a02f20..4655874 100644
--- a/apps/examples/tutorial/mycc/MyCC.cpp
+++ b/apps/examples/tutorial/mycc/MyCC.cpp
@@ -44,10 +44,6 @@ int MyCCFactory::onLoad()
   EnterNumber         = cfg.getParameter("enter_number", 
"/tmp/enter_number.wav"); 
   ConnectSuffix       = cfg.getParameter("connect_suffix", "@127.0.0.1"); 
 
-  if (!AmSession::timersSupported()) {
-    ERROR("load session_timer plug-in for timers\n");
-    return -1;
-  }
   cc_acc_fact = AmPlugIn::instance()->getFactory4Di("cc_acc");
   if(!cc_acc_fact){
     ERROR("could not load cc_acc accounting, please provide a module\n");
diff --git a/apps/ivr/Ivr.cpp b/apps/ivr/Ivr.cpp
index 0d33af5..c7b7d5c 100644
--- a/apps/ivr/Ivr.cpp
+++ b/apps/ivr/Ivr.cpp
@@ -401,11 +401,6 @@ bool IvrFactory::loadScript(const string& path)
  */
 int IvrFactory::onLoad()
 {
-  if (!AmSession::timersSupported()) { 
-    ERROR("load session_timer plug-in (for timers)\n");
-    return -1;
-  }
-
   if(cfg.loadFile(add2path(AmConfig::ModConfigPath,1,MOD_NAME ".conf")))
     return -1;
 
diff --git a/apps/py_sems/PySems.cpp b/apps/py_sems/PySems.cpp
index 4ac5099..1e0d38c 100644
--- a/apps/py_sems/PySems.cpp
+++ b/apps/py_sems/PySems.cpp
@@ -227,11 +227,6 @@ AmSession* PySemsFactory::newDlg(const string& name)
 
   PySemsScriptDesc& mod_desc = mod_it->second;
 
-  if (!AmSession::timersSupported()) {
-    ERROR("load session_timer plugin for timers\n");
-    throw AmSession::Exception(500,SIP_REPLY_SERVER_INTERNAL_ERROR);
-  }
-       
   PyObject* dlg_inst = PyObject_Call(mod_desc.dlg_class,PyTuple_New(0),NULL);
   if(!dlg_inst){
        
@@ -400,11 +395,6 @@ bool PySemsFactory::loadScript(const string& path)
  */
 int PySemsFactory::onLoad()
 {
-  if (!AmSession::timersSupported()) {
-    ERROR("load session_timer plug-in (for timers)\n");
-    return -1;
-  }
-
   AmConfigReader cfg;
 
   if(cfg.loadFile(add2path(AmConfig::ModConfigPath,1,MOD_NAME ".conf")))
diff --git a/apps/sbc/SBC.cpp b/apps/sbc/SBC.cpp
index 824f735..c5a4b1d 100644
--- a/apps/sbc/SBC.cpp
+++ b/apps/sbc/SBC.cpp
@@ -1161,12 +1161,6 @@ void SBCDialog::clearCallTimers() {
 
 /** @return whether successful */
 bool SBCDialog::startCallTimers() {
-  if (call_timers.size() && (!AmSession::timersSupported())) {
-    ERROR("internal implementation error: timers not supported\n");
-    stopCall();
-    return false;
-  }
-
   for (map<int, double>::iterator it=
         call_timers.begin(); it != call_timers.end(); it++) {
     DBG("SBC: starting call timer %i of %f seconds\n", it->first, it->second);
diff --git a/apps/voicemail/AnswerMachine.cpp b/apps/voicemail/AnswerMachine.cpp
index 99139b2..b51b26d 100644
--- a/apps/voicemail/AnswerMachine.cpp
+++ b/apps/voicemail/AnswerMachine.cpp
@@ -451,11 +451,6 @@ int AnswerMachineFactory::onLoad()
   MaxRecordTime   = cfg.getParameterInt("max_record_time",DEFAULT_RECORD_TIME);
   RecFileExt      = cfg.getParameter("rec_file_ext",DEFAULT_AUDIO_EXT);
 
-  if (!AmSession::timersSupported()) { 
-    ERROR("load session_timer plug-in (for timers support)\n");
-    return -1;
-  }
-
   MessageStorage = NULL;
   MessageStorage = AmPlugIn::instance()->getFactory4Di("msg_storage");
   if(NULL == MessageStorage){
diff --git a/core/AmSession.cpp b/core/AmSession.cpp
index bacd2d5..0ac1ff1 100644
--- a/core/AmSession.cpp
+++ b/core/AmSession.cpp
@@ -82,8 +82,7 @@ AmSession::AmSession()
     accept_early_session(false),
     rtp_interface(-1),
     refresh_method(REFRESH_UPDATE_FB_REINV),
-    processing_status(SESSION_PROCESSING_EVENTS),
-    user_timer_ref(NULL)
+    processing_status(SESSION_PROCESSING_EVENTS)
 #ifdef WITH_ZRTP
   ,  zrtp_session(NULL), zrtp_audio(NULL), enable_zrtp(true)
 #endif
@@ -1250,27 +1249,15 @@ string AmSession::localRTPIP()
   return AmConfig::Ifs[rtp_interface].LocalIP;  // "media_ip" parameter.
 }
 
-
-// TODO: move user timers into core
-void AmSession::getUserTimerInstance() {
-  AmDynInvokeFactory* fact = 
-    AmPlugIn::instance()->getFactory4Di("user_timer");
-
-  if (!fact)
-    return;
-
-  user_timer_ref = fact->getInstance();
-}
-
 bool AmSession::timersSupported() {
-  return NULL != AmPlugIn::instance()->getFactory4Di("user_timer") ;
+  WARN("this function is deprecated; application timers are always 
supported\n");
+  return true;
 }
 
 bool AmSession::setTimer(int timer_id, double timeout) {
   if (timeout <= 0.005) {
     DBG("setting timer %d with immediate timeout - posting Event\n", timer_id);
-    AmPluginEvent* ev = new AmPluginEvent("timer_timeout");
-    ev->data.push(timer_id);
+    AmTimeoutEvent* ev = new AmTimeoutEvent(timer_id);
     postEvent(ev);
     return true;
   }
diff --git a/core/AmSession.h b/core/AmSession.h
index 9a32860..d461755 100644
--- a/core/AmSession.h
+++ b/core/AmSession.h
@@ -157,10 +157,6 @@ private:
 
   auto_ptr<AmRtpAudio> _rtp_str;
 
-  AmDynInvoke* user_timer_ref;
-  
-  void getUserTimerInstance();
-
   /** Application parameters passed through P-App-Param HF */
   map<string,string> app_params;
 
@@ -476,8 +472,8 @@ public:
 
   /* ---- general purpose application level timers ------------ */
 
-  /** check for support of timers
-    @return true if application level timers are supported
+  /** Deprecated: check for support of timers
+    @return always true
    */
   static bool timersSupported();
 
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index 653f318..f867882 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -221,7 +221,7 @@ B2B call control
   DI(factory, function [, params...])
     execute DI function
     e.g. DI(factory, function, $var_param, (int)int_param, "str param", 
@select_par, (array)arrayname, (struct)structname, (json)json_object...)
-       DI(user_timer, setTimer, (int)1, (int)5, @local_tag);
+       DI(monitoring, set, "mytable", @local_tag, (int)1);
 
        set($sweets.candy="nice");
        set($sweets.fruit="superb");

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to