diff options
-rw-r--r-- | config/process_put.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/config/process_put.lua b/config/process_put.lua index 33e918a..662b038 100644 --- a/config/process_put.lua +++ b/config/process_put.lua @@ -10,7 +10,7 @@ function process_polycom() local before, xml, after = string.match(data, "(.*<OVERRIDES)([^/]*)(/>.*)") if not xml then return end local attrs = {} - for str in string.gmatch(xml, "%S+") do + for str in string.gmatch(xml, "%S+\".+\"") do local n,v = string.match(str, "([^=]+)=\"(.*)\"") if not attrs[n] then attrs[n] = v @@ -28,6 +28,15 @@ function process_polycom() -- and for rest like "fwdStatus" local num, rest = string.match(n, "reg%.(%d+)%.([%.%a]*)$") + -- this parameter controls the default ringtone + if n == "np.normal.ringing.calls.tonePattern" then + for a,b in pairs(params.value) do + if string.match(a, "reg%d") then + params.value[a].value.polycomringtone.value = string.match(v, "%d+") + end + end + end + -- if rest is defined, then num is defined also if rest == "fwd.busy.contact" then params.value["reg"..num].value.forwardbusy.value = v @@ -48,7 +57,7 @@ function process_polycom() end end - data = before..table.concat(xmlout, " ")..after + data = before.."\n"..table.concat(xmlout, " ").."\n"..after end -- Determine the template |