Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple IMS dedicated bearers #211

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading