Skip to content

Commit

Permalink
Merge pull request #513 from dOpensource/v0.721
Browse files Browse the repository at this point in the history
Critical Hot Fixes for 0.721
  • Loading branch information
mackhendricks committed May 13, 2023
2 parents 362b436 + 32ef733 commit d58a745
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gui/dsiprouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def deleteCarriers():
# grab any related carrier groups
Gatewaygroups = db.execute(
text('SELECT * FROM dr_gw_lists WHERE FIND_IN_SET(:gwid, dr_gw_lists.gwlist)'),
gwid=gwid
{'gwid':gwid}
)

# remove gateway
Expand Down
12 changes: 6 additions & 6 deletions gui/modules/api/api_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,14 +1100,14 @@ def updateEndpointGroups(gwgroupid=None):
Gateway = Gateways(name, sip_addr, strip, prefix, settings.FLT_PBX, gwgroup=gwgroupid)

# Create dispatcher group with the set id being the gateway group id
dispatcher = Dispatcher(setid=gwgroupid, destination=sip_addr, attrs="weight={};".format(weight), description=name)
dispatcher = Dispatcher(setid=gwgroupid, destination=sip_addr, attrs="weight={}".format(weight), description=name)
db.add(dispatcher)

# Create dispatcher for FusionPBX external interface if FusionPBX feature is enabled
if int(fusionpbxenabled) > 0:
sip_addr_external = safeUriToHost(hostname, default_port=5080)
# Add 1000 to the gwgroupid so that the setid for the FusionPBX external interface is 1000 apart
dispatcher = Dispatcher(setid=gwgroupid + 1000, destination=sip_addr_external, attrs="weight={};".format(weight),
dispatcher = Dispatcher(setid=gwgroupid + 1000, destination=sip_addr_external, attrs="weight={}".format(weight),
description=name)
db.add(dispatcher)

Expand Down Expand Up @@ -1242,9 +1242,9 @@ def updateEndpointGroups(gwgroupid=None):
if DispatcherEntry is not None:
db.query(Dispatcher).filter(
(Dispatcher.setid == gwgroupid) & (Dispatcher.destination == "sip:{}".format(sip_addr))).update(
{"attrs": "weight={};".format(weight)}, synchronize_session=False)
{"attrs": "weight={}".format(weight)}, synchronize_session=False)
else:
dispatcher = Dispatcher(setid=gwgroupid, destination=sip_addr, attrs="weight={};".format(weight),
dispatcher = Dispatcher(setid=gwgroupid, destination=sip_addr, attrs="weight={}".format(weight),
description=name)
db.add(dispatcher)

Expand All @@ -1260,7 +1260,7 @@ def updateEndpointGroups(gwgroupid=None):
if DispatcherEntry is not None:
db.query(Dispatcher).filter(
(Dispatcher.setid == int(gwgroupid) + 1000) & (Dispatcher.destination == "sip:{}".format(sip_addr_external))).update(
{"attrs": "weight={};".format(weight)}, synchronize_session=False)
{"attrs": "weight={}".format(weight)}, synchronize_session=False)
else:
# sip_addr_external = safeUriToHost(hostname, default_port=5080)
# dispatcher = Dispatcher(setid=gwgroupid + 1000, destination=sip_addr_external, attrs="weight={};".format(weight),description=name)
Expand Down Expand Up @@ -1643,7 +1643,7 @@ def addEndpointGroups(data=None, endpointGroupType=None, domain=None):
# Create dispatcher group with the set id being the gateway group id
# Don't create a dispatcher set for endpoint groups that was created for MSTeams domains
if endpointGroupType != "msteams":
dispatcher = Dispatcher(setid=gwgroupid, destination=sip_addr, attrs="weight={};".format(weight), description=name)
dispatcher = Dispatcher(setid=gwgroupid, destination=sip_addr, attrs="weight={}".format(weight), description=name)
db.add(dispatcher)

# Create dispatcher for FusionPBX external interface if FusionPBX feature is enabled
Expand Down

0 comments on commit d58a745

Please sign in to comment.