Add opts for the routes subsystem

This commit is contained in:
ionutboangiu
2021-11-11 18:22:42 +02:00
committed by Dan Christian Bogos
parent 007cc0e7c8
commit 1901be0485
26 changed files with 736 additions and 734 deletions

View File

@@ -29,7 +29,7 @@ func init() {
c := &CmdRoutesSort{
name: "routes",
rpcMethod: utils.RouteSv1GetRoutes,
rpcParams: &engine.ArgsGetRoutes{},
rpcParams: &utils.CGREvent{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -38,7 +38,7 @@ func init() {
type CmdRoutesSort struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetRoutes
rpcParams *utils.CGREvent
*CommandExecuter
}
@@ -52,17 +52,14 @@ func (self *CmdRoutesSort) RpcMethod() string {
func (self *CmdRoutesSort) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetRoutes{
CGREvent: new(utils.CGREvent),
}
self.rpcParams = new(utils.CGREvent)
}
return self.rpcParams
}
func (self *CmdRoutesSort) PostprocessRpcParams() error {
if self.rpcParams != nil && self.rpcParams.CGREvent != nil &&
self.rpcParams.CGREvent.Time == nil {
self.rpcParams.CGREvent.Time = utils.TimePointer(time.Now())
if self.rpcParams != nil && self.rpcParams.Time == nil {
self.rpcParams.Time = utils.TimePointer(time.Now())
}
return nil
}