Skip to content
Snippets Groups Projects
Commit 7482a05c authored by Julian Bouzas's avatar Julian Bouzas
Browse files

policy-node.lua: do not handle items with media role if endpoints exist

parent 941da10c
No related branches found
No related tags found
No related merge requests found
......@@ -169,6 +169,13 @@ function handleSiPortInfo (si)
return
end
-- Determine if we can handle item by this policy
local media_role = node.properties["media.role"]
if siendpoints_om:get_n_objects () > 0 and media_role ~= nil then
Log.info (si, "item won't be handled by this policy")
return
end
Log.info (si, "handling item " .. node.properties["node.name"])
-- find target
......@@ -222,6 +229,7 @@ end
default_nodes = Plugin("default-nodes-api")
metadatas_om = ObjectManager { Interest { type = "metadata" } }
siendpoints_om = ObjectManager { Interest { type = "SiEndpoint" }}
siportinfos_om = ObjectManager { Interest { type = "SiPortInfo",
-- only handle si-audio-adapter and si-node
Constraint {
......@@ -256,5 +264,6 @@ siportinfos_om:connect("objects-changed", function (om)
end)
metadatas_om:activate()
siendpoints_om:activate()
siportinfos_om:activate()
silinks_om:activate()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment