Added SessionSv1.SyncSessions in dispatcher

This commit is contained in:
adragusin
2020-02-17 19:10:02 +02:00
committed by Dan Christian Bogos
parent 96fa9f7991
commit bd5c73367c
6 changed files with 12 additions and 7 deletions

View File

@@ -79,7 +79,7 @@ type SessionSv1Interface interface {
InitiateSession(args *sessions.V1InitSessionArgs, rply *sessions.V1InitSessionReply) error
InitiateSessionWithDigest(args *sessions.V1InitSessionArgs, rply *sessions.V1InitReplyWithDigest) error
UpdateSession(args *sessions.V1UpdateSessionArgs, rply *sessions.V1UpdateSessionReply) error
// SyncSessions(args *string, rply *string) error
SyncSessions(args *utils.TenantWithArgDispatcher, rply *string) error
TerminateSession(args *sessions.V1TerminateSessionArgs, rply *string) error
ProcessCDR(cgrEv *utils.CGREventWithArgDispatcher, rply *string) error
ProcessMessage(args *sessions.V1ProcessMessageArgs, rply *sessions.V1ProcessMessageReply) error

View File

@@ -505,10 +505,15 @@ func (dS *DispatcherSessionSv1) SetPassiveSession(args *sessions.Session,
func (dS *DispatcherSessionSv1) ActivateSessions(args *utils.SessionIDsWithArgsDispatcher, reply *string) error {
return dS.dS.SessionSv1ActivateSessions(args, reply)
}
func (dS *DispatcherSessionSv1) DeactivateSessions(args *utils.SessionIDsWithArgsDispatcher, reply *string) error {
return dS.dS.SessionSv1DeactivateSessions(args, reply)
}
func (dS *DispatcherSessionSv1) SyncSessions(args *utils.TenantWithArgDispatcher, rply *string) error {
return dS.dS.SessionSv1SyncSessions(args, rply)
}
func NewDispatcherResponder(dps *dispatchers.DispatcherService) *DispatcherResponder {
return &DispatcherResponder{dS: dps}
}

View File

@@ -58,9 +58,9 @@ func (ssv1 *SessionSv1) UpdateSession(args *sessions.V1UpdateSessionArgs,
return ssv1.Ss.BiRPCv1UpdateSession(nil, args, rply)
}
func (ssv1 *SessionSv1) SyncSessions(args *string,
func (ssv1 *SessionSv1) SyncSessions(args *utils.TenantWithArgDispatcher,
rply *string) error {
return ssv1.Ss.BiRPCv1SyncSessions(nil, "", rply)
return ssv1.Ss.BiRPCv1SyncSessions(nil, &utils.TenantWithArgDispatcher{}, rply)
}
func (ssv1 *SessionSv1) TerminateSession(args *sessions.V1TerminateSessionArgs,

View File

@@ -79,9 +79,9 @@ func (ssv1 *SessionSv1) BiRPCv1UpdateSession(clnt *rpc2.Client, args *sessions.V
return ssv1.Ss.BiRPCv1UpdateSession(clnt, args, rply)
}
func (ssv1 *SessionSv1) BiRPCv1SyncSessions(clnt *rpc2.Client, args *string,
func (ssv1 *SessionSv1) BiRPCv1SyncSessions(clnt *rpc2.Client, args *utils.TenantWithArgDispatcher,
rply *string) error {
return ssv1.Ss.BiRPCv1SyncSessions(clnt, "", rply)
return ssv1.Ss.BiRPCv1SyncSessions(clnt, &utils.TenantWithArgDispatcher{}, rply)
}
func (ssv1 *SessionSv1) BiRPCv1TerminateSession(clnt *rpc2.Client, args *sessions.V1TerminateSessionArgs,

View File

@@ -151,7 +151,7 @@ func (dS *DispatcherService) SessionSv1UpdateSession(args *sessions.V1UpdateSess
}
func (dS *DispatcherService) SessionSv1SyncSessions(args *utils.TenantWithArgDispatcher,
reply *sessions.V1UpdateSessionReply) (err error) {
reply *string) (err error) {
tnt := dS.cfg.GeneralCfg().DefaultTenant
if args.TenantArg != nil && args.TenantArg.Tenant != utils.EmptyString {
tnt = args.TenantArg.Tenant

View File

@@ -3242,7 +3242,7 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector,
// BiRPCv1SyncSessions will sync sessions on demand
func (sS *SessionS) BiRPCv1SyncSessions(clnt rpcclient.ClientConnector,
ignParam string, reply *string) error {
ignParam *utils.TenantWithArgDispatcher, reply *string) error {
sS.syncSessions()
*reply = utils.OK
return nil