From 6764c681561fe9a23c596fb541feebdfd91c3445 Mon Sep 17 00:00:00 2001 From: TeoV Date: Tue, 10 Jul 2018 10:24:41 -0400 Subject: [PATCH] Add Charger in LoaderS --- dispatcher/chargers.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) + +}