/[projects]/smsdaemon/ProxyTransceiver.cpp
ViewVC logotype

Diff of /smsdaemon/ProxyTransceiver.cpp

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

revision 211 by torben, Sun Dec 21 22:08:20 2008 UTC revision 216 by torben, Tue Dec 23 12:09:08 2008 UTC
# Line 7  ProxyTransceiver::ProxyTransceiver(ISmsT Line 7  ProxyTransceiver::ProxyTransceiver(ISmsT
7          : _transceiver(realtransceiver), _hasCC(false)          : _transceiver(realtransceiver), _hasCC(false)
8  {  {
9          Common* cmn = Common::instance();          Common* cmn = Common::instance();
10          _countrycode = cmn->GetConfigfile()->GetValue("smsdaemon","countrycode").StringValue();          _countrycode = cmn->GetConfigfile()->GetValue("smsdaemon","countrycode","").StringValue();
11          if (_countrycode != "")          if (_countrycode != "")
12          {          {
13                  try                  try
# Line 17  ProxyTransceiver::ProxyTransceiver(ISmsT Line 17  ProxyTransceiver::ProxyTransceiver(ISmsT
17                                  _hasCC = true;                                  _hasCC = true;
18                          }                          }
19                  }                  }
20                  catch (std::exception&e)                  catch (...)
21                  {                  {
22                          Logger::logMessage( "Invalid country code:" + _countrycode);                          Logger::logMessage( "Invalid country code:" + _countrycode);
23                  }                                }
24          }          }
25            if (_hasCC)
26                    Logger::logMessage( "Enforcing country code: " + _countrycode);
27            else
28                    Logger::logMessage( "No countrycode enforced");
29  }  }
30    
31    
# Line 40  void ProxyTransceiver::SendSms(std::stri Line 44  void ProxyTransceiver::SendSms(std::stri
44                  if (to.substr(0,_countrycode.size()) != _countrycode)                  if (to.substr(0,_countrycode.size()) != _countrycode)
45                          to.insert(0, _countrycode);                          to.insert(0, _countrycode);
46          }          }
47            
48            if ( Common::instance()->IsBlacklisted(to))
49            {
50                    Logger::logMessage( "Will not send message to blacklisted phone: " + to);
51                    return;
52            }
53    
54          _transceiver.SendSms(to,message,allowMultipart);          _transceiver.SendSms(to,message,allowMultipart);
55  }  }

Legend:
Removed from v.211  
changed lines
  Added in v.216

  ViewVC Help
Powered by ViewVC 1.1.20