Skip to content

Commit

Permalink
Merge pull request #211 from nickvsnetworking/MultipleDedicatedBearers
Browse files Browse the repository at this point in the history
Support for multiple IMS dedicated bearers
  • Loading branch information
nickvsnetworking authored Oct 18, 2024
2 parents 178e1cb + fc0dc9c commit 35f4b4a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3070,6 +3070,8 @@ def Answer_16777236_265(self, packet_vars, avps):
aarOriginHost = bytes.fromhex(aarOriginHost).decode('ascii')
aarOriginRealm = self.get_avp_data(avps, 296)[0]
aarOriginRealm = bytes.fromhex(aarOriginRealm).decode('ascii')
aarSessionID = self.get_avp_data(avps, 263)[0]
aarSessionID = bytes.fromhex(aarSessionID).decode('ascii')
#Check if we have a record-route set as that's where we'll need to send the response
try:
#Get first record-route header, then parse it
Expand Down Expand Up @@ -3266,7 +3268,7 @@ def Answer_16777236_265(self, packet_vars, avps):
"gbr_ul": ulBandwidth,
"precedence": 40,
"arp_priority": 15,
"rule_name": "GBR-Voice",
"rule_name": "GBR-Voice_" + str(aarSessionID),
"arp_preemption_vulnerability": arpPreemptionVulnerability,
"gbr_dl": dlBandwidth,
"tft_group_id": 1,
Expand Down Expand Up @@ -3457,14 +3459,21 @@ def Answer_16777236_275(self, packet_vars, avps):
servingPgwRealm = emergencySubscriberData.get('gx_origin_realm', None)
servingPgw = emergencySubscriberData.get('serving_pgw', None).split(';')[0]

try:
aarSessionID = self.get_avp_data(avps, 263)[0]
aarSessionID = bytes.fromhex(aarSessionID).decode('ascii')
self.logTool.log(service='HSS', level='debug', message=f"[diameter.py] [Answer_16777236_275] [STA] Got Origional SessionID: {aarSessionID}", redisClient=self.redisMessaging)
except:
self.logTool.log(service='HSS', level='debug', message=f"[diameter.py] [Answer_16777236_275] [STA] Error getting Origional SessionID: {traceback.format_exc()}", redisClient=self.redisMessaging)
aarSessionID = ""
if servingApn is not None or emergencySubscriberData:
reAuthAnswer = self.awaitDiameterRequestAndResponse(
requestType='RAR',
hostname=servingPgwPeer,
sessionId=pcrfSessionId,
servingPgw=servingPgw,
servingRealm=servingPgwRealm,
chargingRuleName='GBR-Voice',
chargingRuleName='GBR-Voice_' + str(aarSessionID),
chargingRuleAction='remove'
)

Expand Down

0 comments on commit 35f4b4a

Please sign in to comment.