Do not create dummy vars if they already exists

squeeze-backports
Victor Seva 13 years ago
parent d93e7d2a04
commit 0921da3182

@ -84,12 +84,15 @@ NGCPXAvp_MT = {
end end
function NGCPXAvp:_create(level, group, l) function NGCPXAvp:_create(level, group, l)
local i, name local i
-- create dummy vars local name = string.format("$xavp(%s[1]=>dummy)", group)
name = string.format("$xavp(%s=>dummy)", group) if not sr.pv.get(name) then
NGCPXAvp._setvalue(name, 0, "callee") -- callee -> [1] -- create dummy vars
name = string.format("$xavp(%s=>dummy)", group) name = string.format("$xavp(%s=>dummy)", group)
NGCPXAvp._setvalue(name, 0, "caller") -- caller -> [0] NGCPXAvp._setvalue(name, 0, "callee") -- callee -> [1]
name = string.format("$xavp(%s=>dummy)", group)
NGCPXAvp._setvalue(name, 0, "caller") -- caller -> [0]
end
for i=1,#l do for i=1,#l do
name = string.format("$xavp(%s[%d]=>%s)", group, level, l[i].attribute) name = string.format("$xavp(%s[%d]=>%s)", group, level, l[i].attribute)
table.add(self.keys, l[i].attribute) table.add(self.keys, l[i].attribute)

Loading…
Cancel
Save