diff --git a/dispatcher/chargers.go b/dispatcher/chargers.go index 435e09a15..f362e060a 100755 --- a/dispatcher/chargers.go +++ b/dispatcher/chargers.go @@ -19,12 +19,26 @@ along with this program. If not, see package dispatcher import ( + "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" ) func (dS *DispatcherService) ChargerSv1Ping(ign string, reply *string) error { if dS.chargerS == nil { - return utils.NewErrNotConnected(utils.ChargerS) + return utils.NewErrNotConnected(utils.AttributeS) } return dS.chargerS.Call(utils.ChargerSv1Ping, ign, reply) } + +func (dS *DispatcherService) ChargerSv1GetChargersForEvent(args *ArgsAttrProcessEventWithApiKey, + reply *engine.AttributeProfile) (err error) { + if dS.attrS == nil { + return utils.NewErrNotConnected(utils.AttributeS) + } + if err = dS.authorize(utils.AttributeSv1GetAttributeForEvent, args.AttrArgsProcessEvent.CGREvent.Tenant, + args.APIKey, args.AttrArgsProcessEvent.CGREvent.Time); err != nil { + return + } + return dS.attrS.Call(utils.AttributeSv1GetAttributeForEvent, args.AttrArgsProcessEvent, reply) + +}