Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkneipp committed Oct 9, 2023
2 parents 06d0d8e + 540b68c commit 553b68b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions services/apiService.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,34 @@ def patch(self, subscriber_id):
except:
print("No serving MME set - Not sending CLR")


#If the "enabled" flag on the subscriber is now disabled, trigger a CLR
if 'enabled' in json_data and json_data['enabled'] == False:
print("Subscriber is now disabled, checking to see if we need to trigger a CLR")
#See if we have a serving MME set
try:
assert(json_data['serving_mme'])
print("Serving MME set - Sending CLR")
import diameter
diameter = diameter.Diameter(
OriginHost=yaml_config['hss']['OriginHost'],
OriginRealm=yaml_config['hss']['OriginRealm'],
MNC=yaml_config['hss']['MNC'],
MCC=yaml_config['hss']['MCC'],
ProductName='PyHSS-API-Disabled-CLR'
)
diam_hex = diameter.Request_16777251_317(
imsi=json_data['imsi'],
DestinationHost=json_data['serving_mme'],
DestinationRealm=json_data['serving_mme_realm'],
CancellationType=1
)
logObj = logtool.LogTool()
diameter_next_hop = str(json_data['serving_mme_peer']).split(';')[0]
logObj.Async_SendRequest(diam_hex, diameter_next_hop)
print("Sent CLR via Peer " + str(diameter_next_hop))
except:
print("No serving MME set - Not sending CLR")
print("Updated object")
print(data)
return data, 200
Expand Down

0 comments on commit 553b68b

Please sign in to comment.