Don't allow extensions to be a prefix of other extensions
This commit is contained in:
parent
6a227b4dce
commit
710d68268f
@ -34,6 +34,10 @@ class ExtensionConfig:
|
|||||||
raise Exception("static_target is required for static extension {}".format(self.num))
|
raise Exception("static_target is required for static extension {}".format(self.num))
|
||||||
|
|
||||||
def check_global(self, extensions):
|
def check_global(self, extensions):
|
||||||
|
for e in extensions.extensions:
|
||||||
|
if e.num != self.num and e.num.startswith(self.num):
|
||||||
|
raise Exception("Extension {} uses {} as prefix, which is already defined as an extension".format(e.num, self.num))
|
||||||
|
|
||||||
if self.type == "callgroup":
|
if self.type == "callgroup":
|
||||||
for member in self.callgroup_members:
|
for member in self.callgroup_members:
|
||||||
if member not in extensions.extensions_by_num.keys():
|
if member not in extensions.extensions_by_num.keys():
|
||||||
|
Loading…
Reference in New Issue
Block a user