conf: create-endpoint.lua: make sure endpoints always have a valid name

This commit is contained in:
Julian Bouzas 2021-01-25 09:45:52 -05:00
parent 0beefe4d7e
commit d315898477

View file

@ -12,9 +12,9 @@ session_items = {
function addEndpoint (node, session_name, endpoint_type, priority)
local id = node["bound-id"]
local name = node.properties['node.name']
local media_class = node.properties['media.class']
local session = nil
local name = nil
-- find the session
session = sessions_om:lookup(Interest { type = "session",
@ -25,6 +25,12 @@ function addEndpoint (node, session_name, endpoint_type, priority)
return
end
-- get the endpoint name
name = node.properties['node.name']
if name == nil then
name = "endpoint.node." .. id
end
-- create endpoint
session_items.endpoints[id] = SessionItem ( endpoint_type )