mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added API to determine on what engine the API was called
This commit is contained in:
committed by
Dan Christian Bogos
parent
c25bfd99fc
commit
f237785164
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -1660,6 +1660,7 @@ const (
|
||||
DispatcherSv1GetProfilesForEvent = "DispatcherSv1.GetProfilesForEvent"
|
||||
DispatcherSv1Apier = "DispatcherSv1.Apier"
|
||||
DispatcherServicePing = "DispatcherService.Ping"
|
||||
DispatcherSv1RemoteStatus = "DispatcherSv1.RemoteStatus"
|
||||
)
|
||||
|
||||
// RegistrarS APIs
|
||||
|
||||
Reference in New Issue
Block a user