From: Elena Mamontova Date: Tue, 18 Oct 2016 13:22:48 +0000 (+0300) Subject: Ticket 37. if(strcasecmp(el, "ChangePolicyTimeout") == 0) construction X-Git-Tag: 2.409~61 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/c302e7d5fe848d1b06d3e2b40cd13836525b74a0?hp=388f004853f28a62098da68f9e3037c6a7ec8f2f Ticket 37. if(strcasecmp(el, "ChangePolicyTimeout") == 0) construction added in CHG_TARIFF::Start(). "ChangePolicyTimeout value" string added in m_answer variable in GET_TARIFFS::CreateAnswer(). --- diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp index 867181af..b2b07997 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp @@ -115,6 +115,7 @@ void GET_TARIFFS::CreateAnswer() "tariffConf.traffType) + "\"/>" + "tariffConf.period) + "\"/>" + "tariffConf.changePolicy) + "\"/>" + + "tariffConf.changePolicyTimeout) + "\"/>" + ""; } @@ -299,6 +300,14 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) 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; }