"<Free value=\"" + x2str(it->tariffConf.free) + "\"/>" +
"<TraffType value=\"" + TARIFF::TraffTypeToString(it->tariffConf.traffType) + "\"/>" +
"<Period value=\"" + TARIFF::PeriodToString(it->tariffConf.period) + "\"/>" +
+ "<ChangePolicy value=\"" + TARIFF::ChangePolicyToString(it->tariffConf.changePolicy) + "\"/>" +
+ "<ChangePolicyTimeout value=\"" + x2str(it->tariffConf.changePolicyTimeout) + "\"/>" +
"</tariff>";
}
{
if (strcasecmp(el, m_tag.c_str()) == 0)
{
- td.tariffConf.name = attr[1];
+ const TARIFF * tariff = m_tariffs.FindByName(attr[1]);
+ if (tariff != NULL)
+ td = tariff->GetTariffData();
+ else
+ return -1;
return 0;
}
}
td.tariffConf.period = TARIFF::StringToPeriod(attr[1]);
return 0;
}
+
+ if (strcasecmp(el, "ChangePolicy") == 0)
+ {
+ td.tariffConf.changePolicy = TARIFF::StringToChangePolicy(attr[1]);
+ return 0;
+ }
+
+ if (strcasecmp(el, "ChangePolicyTimeout") == 0)
+ {
+ long int policyTime = 0;
+ if (str2x(attr[1], policyTime) == 0)
+ td.tariffConf.changePolicyTimeout = (time_t)policyTime;
+ return 0;
+ }
}
return -1;
}