--- smsdaemon/SmsToolTransceiver.cpp 2008/12/08 21:49:49 158 +++ smsdaemon/SmsToolTransceiver.cpp 2008/12/09 19:42:45 167 @@ -2,6 +2,7 @@ #include "Logger.h" #include "Util.h" +#include "Common.h" #include #include @@ -37,6 +38,8 @@ } out << "To: " << to << "\n\n" << message ; out.close(); + + Common::instance()->smsCounter.outgoing++; int result = rename(tempfile.c_str(), destfile.c_str()); @@ -56,9 +59,9 @@ std::vector SmsToolTransceiver::ReadSms(bool readAll) { - const std::string incoming = "/var/spool/sms/incoming/"; + const std::string inbox = "/var/spool/sms/inbox/"; std::vector vec; - DIR* dir = opendir( incoming.c_str() ); + DIR* dir = opendir( inbox.c_str() ); if (dir != 0) { @@ -67,10 +70,11 @@ { if (entry->d_name[0] == '.') continue; - + Logger::logMessage( string("SmsTool::ReadSms >") +entry->d_name); + try { - SMS sms = ParseFile( incoming + entry->d_name); + SMS sms = ParseFile( inbox + entry->d_name); vec.push_back(sms); } catch (std::exception& e) @@ -84,7 +88,7 @@ } else { - Logger::logMessage( string("SmsToolTransceiver could open incoming dir ") + strerror(errno) ); + Logger::logMessage( string("SmsToolTransceiver could open inbox dir ") + strerror(errno) ); } closedir(dir); @@ -135,15 +139,22 @@ for (unsigned int i=0; i ") + headers[i]); + } } }