- if (!strcasecmp(str.c_str(), "down"))
- td->tariffConf.traffType = TRAFF_DOWN;
- else
- if (!strcasecmp(str.c_str(), "up+down"))
- td->tariffConf.traffType = TRAFF_UP_DOWN;
- else
- if (!strcasecmp(str.c_str(), "max"))
- td->tariffConf.traffType = TRAFF_MAX;
- else
- {
- STG_LOCKER lock(&mutex, __FILE__, __LINE__);
- errorStr = "Cannot read tariff " + tariffName + ". Parameter TraffType incorrect";
- printfd(__FILE__, "FILES_STORE::RestoreTariff - invalid trafftype for tariff '%s'\n", tariffName.c_str());
- return -1;
- }
+ td->tariffConf.period = TARIFF::StringToPeriod(str);
+
+if (conf.ReadString("ChangePolicy", &str, "allow") < 0)
+ td->tariffConf.changePolicy = TARIFF::ALLOW;
+else
+ td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(str);
+
+if (conf.ReadString("ChangePolicyTimeout", &str, "1970-01-01 00:00:00") < 0)
+ td->tariffConf.changePolicyTimeout = 0;
+else
+ td->tariffConf.changePolicyTimeout = readTime(str);