diff --git a/apier/v1/dispatcher.go b/apier/v1/dispatcher.go index e5b5f9bd9..c48c2f7b8 100644 --- a/apier/v1/dispatcher.go +++ b/apier/v1/dispatcher.go @@ -754,6 +754,10 @@ func (dSv1 DispatcherSv1) GetProfilesForEvent(ev *utils.CGREvent, return dSv1.dS.V1GetProfilesForEvent(ev, dPrfl) } +func (dS *DispatcherSv1) RemoteStatus(args *utils.TenantWithAPIOpts, reply *map[string]interface{}) (err error) { + return dS.dS.DispatcherSv1RemoteStatus(args, reply) +} + /* func (dSv1 DispatcherSv1) Apier(args *utils.MethodParameters, reply *interface{}) (err error) { return dSv1.dS.V1Apier(new(APIerSv1), args, reply) diff --git a/dispatchers/dispatchers.go b/dispatchers/dispatchers.go index 4fcbdc9d3..13e379c3f 100644 --- a/dispatchers/dispatchers.go +++ b/dispatchers/dispatchers.go @@ -361,3 +361,21 @@ func (dS *DispatcherService) Call(serviceMethod string, // all API fuction must } return err } + +func (dS *DispatcherService) DispatcherSv1RemoteStatus(args *utils.TenantWithAPIOpts, + reply *map[string]interface{}) (err error) { + tnt := dS.cfg.GeneralCfg().DefaultTenant + if args.Tenant != utils.EmptyString { + tnt = args.Tenant + } + if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { + if err = dS.authorize(utils.CoreSv1Status, tnt, + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + return + } + } + return dS.Dispatch(&utils.CGREvent{ + Tenant: tnt, + APIOpts: args.APIOpts, + }, utils.MetaCore, utils.CoreSv1Status, args, reply) +} diff --git a/utils/consts.go b/utils/consts.go index ea9a37f30..09e44c7f6 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -1660,6 +1660,7 @@ const ( DispatcherSv1GetProfilesForEvent = "DispatcherSv1.GetProfilesForEvent" DispatcherSv1Apier = "DispatcherSv1.Apier" DispatcherServicePing = "DispatcherService.Ping" + DispatcherSv1RemoteStatus = "DispatcherSv1.RemoteStatus" ) // RegistrarS APIs