mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Refactor ReAuthorize to AlterSessions
This commit is contained in:
committed by
Dan Christian Bogos
parent
ec9b95088f
commit
f9d1c0f0e1
@@ -47,7 +47,7 @@ var authReqs = engine.MapEvent{
|
||||
type BiRPCClient interface {
|
||||
V1DisconnectSession(*context.Context, utils.AttrDisconnectSession, *string) error
|
||||
V1GetActiveSessionIDs(*context.Context, string, *[]*SessionID) error
|
||||
V1ReAuthorize(*context.Context, utils.CGREvent, *string) error
|
||||
V1AlterSessions(*context.Context, utils.CGREvent, *string) error
|
||||
V1DisconnectPeer(*context.Context, *utils.DPRArgs, *string) error
|
||||
V1WarnDisconnect(*context.Context, map[string]any, *string) error
|
||||
}
|
||||
|
||||
@@ -4006,7 +4006,7 @@ func (sS *SessionS) sendRar(ctx *context.Context, s *Session, apiOpts map[string
|
||||
clnt := sS.biJClnt(s.ClientConnID)
|
||||
if clnt == nil {
|
||||
return fmt.Errorf("calling %s requires bidirectional JSON connection, connID: <%s>",
|
||||
utils.SessionSv1ReAuthorize, s.ClientConnID)
|
||||
utils.SessionSv1AlterSessions, s.ClientConnID)
|
||||
}
|
||||
|
||||
// Merge parameter event with the session event. Losing the EventStart OriginID
|
||||
@@ -4027,14 +4027,14 @@ func (sS *SessionS) sendRar(ctx *context.Context, s *Session, apiOpts map[string
|
||||
}
|
||||
|
||||
var rply string
|
||||
if err = clnt.conn.Call(ctx, utils.SessionSv1ReAuthorize, args, &rply); err == utils.ErrNotImplemented {
|
||||
if err = clnt.conn.Call(ctx, utils.SessionSv1AlterSessions, args, &rply); err == utils.ErrNotImplemented {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// BiRPCv1ReAuthorize sends a RAR for the matching sessions
|
||||
func (sS *SessionS) BiRPCv1ReAuthorize(ctx *context.Context,
|
||||
// BiRPCv1AlterSessions sends a RAR for the matching sessions
|
||||
func (sS *SessionS) BiRPCv1AlterSessions(ctx *context.Context,
|
||||
args utils.SessionFilterWithEvent, reply *string) (err error) {
|
||||
if args.SessionFilter == nil { //protection in case on nil
|
||||
args.SessionFilter = &utils.SessionFilter{}
|
||||
|
||||
Reference in New Issue
Block a user