Skip to content

Commit

Permalink
[zarya] hotfix for subscriber roaming check
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkneipp committed Jan 6, 2024
1 parent dc31bd1 commit c1776ea
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,14 +1282,16 @@ def Answer_16777251_316(self, packet_vars, avps):
decodedPlmn = self.DecodePLMN(plmn=plmn)
mcc = decodedPlmn[0]
mnc = decodedPlmn[1]
subscriberIsRoaming = False
subscriberRoamingAllowed = False
if str(mcc) != str(self.MCC) and str(mnc) != str(self.MNC):
subscriberIsRoaming = True

if subscriberIsRoaming:
self.logTool.log(service='HSS', level='debug', message=f"[diameter.py] [Answer_16777251_318] [AIA] Subscriber {imsi} is roaming", redisClient=self.redisMessaging)
self.logTool.log(service='HSS', level='debug', message=f"[diameter.py] [Answer_16777251_318] [ULA] Subscriber {imsi} is roaming", redisClient=self.redisMessaging)
subscriberRoamingAllowed = self.validateSubscriberRoaming(subscriber=subscriber_details, mcc=mcc, mnc=mnc)

if not subscriberRoamingAllowed:
if not subscriberRoamingAllowed and subscriberIsRoaming:
avp = ''
session_id = self.get_avp_data(avps, 263)[0] #Get Session-ID
avp += self.generate_avp(263, 40, session_id) #Session-ID AVP set
Expand Down Expand Up @@ -1608,14 +1610,16 @@ def Answer_16777251_318(self, packet_vars, avps):
decodedPlmn = self.DecodePLMN(plmn=plmn)
mcc = decodedPlmn[0]
mnc = decodedPlmn[1]
subscriberIsRoaming = False
subscriberRoamingAllowed = False
if str(mcc) != str(self.MCC) and str(mnc) != str(self.MNC):
subscriberIsRoaming = True

if subscriberIsRoaming:
self.logTool.log(service='HSS', level='debug', message=f"[diameter.py] [Answer_16777251_318] [AIA] Subscriber {imsi} is roaming", redisClient=self.redisMessaging)
subscriberRoamingAllowed = self.validateSubscriberRoaming(subscriber=subscriber_details, mcc=mcc, mnc=mnc)

if not subscriberRoamingAllowed:
if not subscriberRoamingAllowed and subscriberIsRoaming:
avp = ''
session_id = self.get_avp_data(avps, 263)[0] #Get Session-ID
avp += self.generate_avp(263, 40, session_id) #Session-ID AVP set
Expand Down

0 comments on commit c1776ea

Please sign in to comment.