feat(session_proxy): add a flag to disable Service Requested Unit AVP#8697
Conversation
|
Thanks for opening a PR! 💯 A couple initial guidelines
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
feg-workflow 2 files 145 suites 30s ⏱️ Results for commit 18fe0a6. ♻️ This comment has been updated with latest results. |
| configsPtr := &mconfig.SessionProxyConfig{} | ||
| err := managed_configs.GetServiceConfigs(credit_control.SessionProxyServiceName, configsPtr) | ||
| siStr := diameter.GetValueOrEnv(OCSServiceIdentifierFlag, OCSServiceIdentifierEnv, "") | ||
| avp437 := diameter.GetValueOrEnv(OCSServiceIdentifierFlag, DisableRequestedGrantedUnitsAVPEnv, "") |
There was a problem hiding this comment.
copy/paste, should be:
avp437 := diameter.GetValueOrEnv(DisableRequestedGrantedUnitsAVPFlag, DisableRequestedGrantedUnitsAVPEnv, "")
emakeev
left a comment
There was a problem hiding this comment.
please see comment inline.
emakeev
left a comment
There was a problem hiding this comment.
pls, see comments inline
| OCSServiceIdentifier string | ||
| DisableGy bool | ||
| VirtualApnRules []*credit_control.VirtualApnRule | ||
| DisableServiceGrantedUnitsAVP string |
There was a problem hiding this comment.
Wouldn't it be better to make it bool? Like DisableGy above
| _ = flag.String(GyInitMethodFlag, "", "Gy init method (per_key|per_session)") | ||
| _ = flag.String(OCSApnOverwriteFlag, "", "OCS APN to use instead of request's APN") | ||
| _ = flag.String(OCSServiceIdentifierFlag, "", "OCS ServiceIdentifier to use in Gy requests") | ||
| _ = flag.String(DisableRequestedGrantedUnitsAVPFlag, "", "Disable Requested-Service-Unit AVP (437)") |
There was a problem hiding this comment.
I'd make it Bool here.
avp437Flag = flag.Bool(DisableRequestedGrantedUnitsAVPFlag, false, "Disable Requested-Service-Unit AVP (437)")
| configsPtr := &mconfig.SessionProxyConfig{} | ||
| err := managed_configs.GetServiceConfigs(credit_control.SessionProxyServiceName, configsPtr) | ||
| siStr := diameter.GetValueOrEnv(OCSServiceIdentifierFlag, OCSServiceIdentifierEnv, "") | ||
| avp437 := diameter.GetValueOrEnv(OCSServiceIdentifierFlag, DisableRequestedGrantedUnitsAVPEnv, "") |
There was a problem hiding this comment.
I think, it may be cleaner to make it bool, you can do something like this:
avp437 := *avp437Flag || util.IsTruthyEnv(DisableRequestedGrantedUnitsAVPEnv)
56113b2 to
ce45c4a
Compare
Signed-off-by: Oriol Batalla <[email protected]>
ce45c4a to
18fe0a6
Compare
Signed-off-by: Oriol Batalla [email protected]
Summary
To support some specific vendors we need to set Service Requested Unit AVP as empty. This PR adds a flag to session_proxy service to disable that AVP.
To disable that, go to
.envfile and crateTest Plan
Additional Information