--- smsdaemon/ProxyTransceiver.cpp 2008/12/21 22:08:20 211 +++ smsdaemon/ProxyTransceiver.cpp 2008/12/23 14:20:43 217 @@ -2,12 +2,13 @@ #include "ConfigFile.h" #include "Common.h" #include "Logger.h" +#include "AccessManager.h" ProxyTransceiver::ProxyTransceiver(ISmsTransceiver& realtransceiver) : _transceiver(realtransceiver), _hasCC(false) { Common* cmn = Common::instance(); - _countrycode = cmn->GetConfigfile()->GetValue("smsdaemon","countrycode").StringValue(); + _countrycode = cmn->GetConfigfile()->GetValue("smsdaemon","countrycode","").StringValue(); if (_countrycode != "") { try @@ -17,11 +18,15 @@ _hasCC = true; } } - catch (std::exception&e) + catch (...) { Logger::logMessage( "Invalid country code:" + _countrycode); - } + } } + if (_hasCC) + Logger::logMessage( "Enforcing country code: " + _countrycode); + else + Logger::logMessage( "No countrycode enforced"); } @@ -40,6 +45,12 @@ if (to.substr(0,_countrycode.size()) != _countrycode) to.insert(0, _countrycode); } + + if ( AccessManager::IsBlacklisted(to)) + { + Logger::logMessage( "Will not send message to blacklisted phone: " + to); + return; + } _transceiver.SendSms(to,message,allowMultipart); }