summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Arruda <joao.arruda@gmail.com>2015-06-02 16:45:51 -0300
committerTed Trask <ttrask01@yahoo.com>2015-06-02 17:12:59 -0400
commit7d4cc698a4703624d8fb0d16825f403c1aa2e3a8 (patch)
tree5f82387211cd4a9fcd977c8bab6e5834ca38c7c7
parentf789102e91a2a3e02b0f13173129fbcebb437607 (diff)
downloadacf-provisioning-7d4cc698a4703624d8fb0d16825f403c1aa2e3a8.tar.bz2
acf-provisioning-7d4cc698a4703624d8fb0d16825f403c1aa2e3a8.tar.xz
Update process_put.lua to send language, 24HourClock and tonePattern values to DB
Signed-off-by: Ted Trask <ttrask01@yahoo.com>
-rw-r--r--config/process_put.lua58
1 files changed, 37 insertions, 21 deletions
diff --git a/config/process_put.lua b/config/process_put.lua
index 8497746..1fed1ae 100644
--- a/config/process_put.lua
+++ b/config/process_put.lua
@@ -23,32 +23,48 @@ function process_polycom()
-- Read attributes from attrs and generate paramaters for ACF
local xmlout = {}
- for n,v in pairs(attrs) do
- -- search attribute name for reg_name like "reg.1."
- -- and for rest like "fwdStatus"
- local num, rest = string.match(n, "reg%.(%d+)%.([%.%a]*)$")
-
- -- if rest is defined, then num is defined also
- if rest == "fwd.busy.contact" then
- params.value["reg"..num].value.forwardbusy.value = v
- elseif rest == "fwd.noanswer.contact" then
- params.value["reg"..num].value.forwardnoanswer.value = v
- elseif rest == "fwdContact" then
- params.value["reg"..num].value.forwardall.value = v
- elseif rest == "fwd.busy.status" then
- params.value["reg"..num].value.forwardbusyenable.value = (v == "1")
- elseif rest == "fwd.noanswer.status" then
- params.value["reg"..num].value.forwardnoanswerenable.value = (v == "1")
- elseif rest == "fwdStatus" then
- params.value["reg"..num].value.forwardallenable.value = (v == "1")
- elseif rest == "ringType" then
- params.value["reg"..num].value.polycomringtone.value = string.match(v, "%d+")
+ for n,v in pairs(attrs) do
+
+ -- this attribute controls the default ringtone, when the phone have only one reg
+ if n == "np.normal.ringing.calls.tonePattern" then
+ params.value.reg1.value.polycomringtone.value = string.match(v, "%d+")
+
+ -- this attribute controls the display language
+ elseif n == "lcl.ml.lang" then
+ params.value.device.value.displaylang.value = v
+
+ -- found any attribute related with 24HourClock
+ elseif string.find(n, "24HourClock") then
+ params.value.device.value.militarytimeenable.value = (v == "1")
+
else
- xmlout[#xmlout+1] = n.."=\""..v.."\""
+ -- search attribute name for reg_name like "reg.1."
+ -- and for rest like "fwdStatus"
+ local num, rest = string.match(n, "reg%.(%d+)%.([%.%a]*)$")
+
+ -- if rest is defined, then num is defined also
+ if rest == "fwd.busy.contact" then
+ params.value["reg"..num].value.forwardbusy.value = v
+ elseif rest == "fwd.noanswer.contact" then
+ params.value["reg"..num].value.forwardnoanswer.value = v
+ elseif rest == "fwdContact" then
+ params.value["reg"..num].value.forwardall.value = v
+ elseif rest == "fwd.busy.status" then
+ params.value["reg"..num].value.forwardbusyenable.value = (v == "1")
+ elseif rest == "fwd.noanswer.status" then
+ params.value["reg"..num].value.forwardnoanswerenable.value = (v == "1")
+ elseif rest == "fwdStatus" then
+ params.value["reg"..num].value.forwardallenable.value = (v == "1")
+ elseif rest == "ringType" then
+ params.value["reg"..num].value.polycomringtone.value = string.match(v, "%d+")
+ else
+ xmlout[#xmlout+1] = n.."=\""..v.."\""
+ end
end
end
data = before.." "..table.concat(xmlout, " ").." "..after
+
end
-- Determine the template