/[projects]/smsdaemon/plugins/ShellExecPlugin.cpp
ViewVC logotype

Diff of /smsdaemon/plugins/ShellExecPlugin.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 107 by torben, Thu Jun 19 14:47:52 2008 UTC revision 158 by torben, Mon Dec 8 21:49:49 2008 UTC
# Line 1  Line 1 
1  #include "ShellExecPlugin.h"  #include "ShellExecPlugin.h"
2  #include "IGsmModem.h"  #include "ISmsTransceiver.h"
3  #include "Sms.h"  #include "Sms.h"
4    
5  #include "util.h"  #include "Util.h"
6    
7  ShellExecPlugin::ShellExecPlugin(std::string pluginCommand, std::string exeCommand, bool allowParameters, bool returnOutput)  ShellExecPlugin::ShellExecPlugin(std::string pluginCommand, std::string exeCommand, bool allowParameters, bool returnOutput)
8    : Plugin(pluginCommand, std::string("ShellExec: ")+exeCommand ),    : Plugin(pluginCommand, std::string("ShellExec: ")+exeCommand ),
# Line 12  ShellExecPlugin::ShellExecPlugin(std::st Line 12  ShellExecPlugin::ShellExecPlugin(std::st
12  {  {
13  }  }
14    
15  void ShellExecPlugin::Execute(IGsmModem& modem, SMS& sms)  void ShellExecPlugin::Execute(ISmsTransceiver& modem, SMS& sms)
16  {  {
17          std::string command = _exeCommand;          std::string command = _exeCommand;
18    
19          if (_allowParameters)          if (_allowParameters)
20          {          {
21                  std::string parameters = GetSmsData(sms);                  std::string parameters = sms.ExtractParameters();
22    
23                  parameters = Util::str_replace(parameters, "||");                  parameters = Util::str_replace(parameters, "||");
24                  parameters = Util::str_replace(parameters, "&&");                  parameters = Util::str_replace(parameters, "&&");
# Line 48  void ShellExecPlugin::Execute(IGsmModem& Line 48  void ShellExecPlugin::Execute(IGsmModem&
48                          message = "OK";                          message = "OK";
49          }          }
50                    
51          modem.SendSms(sms.sender, message, false );          modem.SendSms(sms.GetSender(), message, false );
52  }  }

Legend:
Removed from v.107  
changed lines
  Added in v.158

  ViewVC Help
Powered by ViewVC 1.1.20