Skip to content

Commit

Permalink
Reply with valid UDA on MSISDN not found
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkneipp committed Oct 3, 2024
1 parent 690293b commit a07ad9c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2795,6 +2795,14 @@ def Answer_16777217_306(self, packet_vars, avps):
except Exception as e:
self.logTool.log(service='HSS', level='debug', message="No Username", redisClient=self.redisMessaging)

session_id = self.get_avp_data(avps, 263)[0] #Get Session-ID
avp += self.generate_avp(263, 40, session_id) #Set session ID to received session ID
avp += self.generate_avp(264, 40, self.OriginHost) #Origin Host
avp += self.generate_avp(296, 40, self.OriginRealm) #Origin Realm
avp += self.generate_avp(277, 40, "00000001") #Auth-Session-State (No state maintained)

avp += self.generate_avp(260, 40, "0000010a4000000c000028af000001024000000c01000001") #Vendor-Specific-Application-ID for Cx

if msisdn is not None:
self.logTool.log(service='HSS', level='debug', message="Getting subscriber IMS info based on MSISDN", redisClient=self.redisMessaging)
try:
Expand Down Expand Up @@ -2845,14 +2853,6 @@ def Answer_16777217_306(self, packet_vars, avps):
avp += self.generate_avp(297, 40, avp_experimental_result) #AVP Experimental-Result(297)
response = self.generate_diameter_packet("01", "40", 306, 16777217, packet_vars['hop-by-hop-identifier'], packet_vars['end-to-end-identifier'], avp) #Generate Diameter packet
return response

session_id = self.get_avp_data(avps, 263)[0] #Get Session-ID
avp += self.generate_avp(263, 40, session_id) #Set session ID to received session ID
avp += self.generate_avp(264, 40, self.OriginHost) #Origin Host
avp += self.generate_avp(296, 40, self.OriginRealm) #Origin Realm
avp += self.generate_avp(277, 40, "00000001") #Auth-Session-State (No state maintained)

avp += self.generate_avp(260, 40, "0000010a4000000c000028af000001024000000c01000001") #Vendor-Specific-Application-ID for Cx

#Sh-User-Data (XML)
#This loads a Jinja XML template containing the Sh-User-Data
Expand Down

0 comments on commit a07ad9c

Please sign in to comment.