mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update subflags for *rals from SessionSv1.ProcessEvent
This commit is contained in:
committed by
Dan Christian Bogos
parent
9f80f5e9b2
commit
b92e96d446
@@ -150,7 +150,7 @@ func testSSv1ItProcessEventAuth(t *testing.T) {
|
||||
authUsage := 5 * time.Minute
|
||||
args := &sessions.V1ProcessEventArgs{
|
||||
Flags: []string{utils.ConcatenatedKey(utils.MetaResources, utils.MetaAuthorize),
|
||||
utils.ConcatenatedKey(utils.MetaRALs, utils.MetaAuth),
|
||||
utils.ConcatenatedKey(utils.MetaRALs, utils.MetaAuthorize),
|
||||
utils.MetaSuppliers, utils.MetaAttributes},
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
@@ -229,7 +229,7 @@ func testSSv1ItProcessEventAuth(t *testing.T) {
|
||||
func testSSv1ItProcessEventInitiateSession(t *testing.T) {
|
||||
initUsage := 5 * time.Minute
|
||||
args := &sessions.V1ProcessEventArgs{
|
||||
Flags: []string{utils.ConcatenatedKey(utils.MetaRALs, utils.MetaInit),
|
||||
Flags: []string{utils.ConcatenatedKey(utils.MetaRALs, utils.MetaInitiate),
|
||||
utils.ConcatenatedKey(utils.MetaResources, utils.MetaAllocate), utils.MetaAttributes},
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
|
||||
@@ -329,10 +329,10 @@ Instead of arguments, the options for enabling various functionaity will come in
|
||||
\*rals
|
||||
Process the event with :ref:`RALs`. Auxiliary flags available:
|
||||
|
||||
**\*auth**
|
||||
**\*authorize**
|
||||
Authorize the event.
|
||||
|
||||
**\*init**
|
||||
**\*initiate**
|
||||
Initialize a session out of event.
|
||||
|
||||
**\*update**
|
||||
|
||||
@@ -20,6 +20,7 @@ cgrates (0.10.1~dev) UNRELEASED; urgency=medium
|
||||
DataDB/StorDB
|
||||
* [Migrator] Auto discover tenant from key instead of taking it from config
|
||||
* [Templates] Fixed missing "*" for strip and padding strategy
|
||||
* [SessionS] Update subflags for *rals ( *authorize and *initiate )
|
||||
|
||||
-- Alexandru Tripon <alexandru.tripon@itsyscom.com> Wed, 19 Feb 2020 15:22:59 +0200
|
||||
|
||||
|
||||
@@ -3037,7 +3037,7 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector,
|
||||
//for the moment only the the flag will be executed
|
||||
switch {
|
||||
//check for auth session
|
||||
case ralsFlagsWithParams.HasKey(utils.MetaAuth):
|
||||
case ralsFlagsWithParams.HasKey(utils.MetaAuthorize):
|
||||
maxUsage, err := sS.authEvent(args.CGREvent.Tenant,
|
||||
engine.MapEvent(args.CGREvent.Event))
|
||||
if err != nil {
|
||||
@@ -3045,7 +3045,7 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector,
|
||||
}
|
||||
rply.MaxUsage = maxUsage
|
||||
// check for init session
|
||||
case ralsFlagsWithParams.HasKey(utils.MetaInit):
|
||||
case ralsFlagsWithParams.HasKey(utils.MetaInitiate):
|
||||
if ev.HasField(utils.CGRDebitInterval) { // dynamic DebitInterval via CGRDebitInterval
|
||||
if dbtItvl, err = ev.GetDuration(utils.CGRDebitInterval); err != nil {
|
||||
return utils.NewErrRALs(err)
|
||||
|
||||
Reference in New Issue
Block a user