]> git.stg.codes - stg.git/commitdiff
Ticket 37. if(strcasecmp(el, "ChangePolicyTimeout") == 0) construction
authorElena Mamontova <helenh463@gmail.com>
Tue, 18 Oct 2016 13:22:48 +0000 (16:22 +0300)
committerElena Mamontova <helenh463@gmail.com>
Tue, 18 Oct 2016 13:22:48 +0000 (16:22 +0300)
added in CHG_TARIFF::Start(). "ChangePolicyTimeout value" string added
in m_answer variable in GET_TARIFFS::CreateAnswer().

projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp

index 867181afda0e95631d1d6f459557e4f4b33351cf..b2b079978f869cf7a52f32f572deb97853b8870d 100644 (file)
@@ -115,6 +115,7 @@ void GET_TARIFFS::CreateAnswer()
                   "<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>";
         }
 
@@ -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;
 }