blob: df8f5c27e286a4cb862f68d0217e40b353040668 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
-- This is the script run to determine the device class from the HTTP user agent
local functions, agent, classes = ...
APP.logevent("got to determine_class script")
local manufacture, model
if string.match(agent, "Polycom") then
manufacture = "Polycom"
model = string.match(agent, "Polycom[^%s%d]+(%d+)")
end
APP.logevent("Found "..(manufacture or "").." model "..(model or ""))
if manufacture and model then
for i,c in ipairs(classes.value) do
if string.match(c.label, manufacture) and string.match(c.label, model) then
return c.class_id
end
end
end
|