mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
more commands and help
This commit is contained in:
@@ -44,6 +44,30 @@ var (
|
||||
)
|
||||
|
||||
func executeCommand(command string) {
|
||||
if strings.TrimSpace(command) == "help" {
|
||||
commands := console.GetCommands()
|
||||
fmt.Println("Commands:")
|
||||
for name, cmd := range commands {
|
||||
fmt.Print(name, cmd.Usage())
|
||||
}
|
||||
return
|
||||
}
|
||||
if strings.HasPrefix(command, "help") {
|
||||
words := strings.Split(command, " ")
|
||||
if len(words) > 1 {
|
||||
commands := console.GetCommands()
|
||||
if cmd, ok := commands[words[1]]; ok {
|
||||
fmt.Print(cmd.Usage())
|
||||
} else {
|
||||
fmt.Print("Available commands: ")
|
||||
for name, _ := range commands {
|
||||
fmt.Print(name + " ")
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
cmd, cmdErr := console.GetCommandValue(command, *verbose)
|
||||
if cmdErr != nil {
|
||||
fmt.Println(cmdErr)
|
||||
|
||||
@@ -47,6 +47,9 @@ func (self *CmdAddAccount) RpcMethod() string {
|
||||
}
|
||||
|
||||
func (self *CmdAddAccount) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &apier.AttrSetAccount{Direction: "*out"}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ func init() {
|
||||
c := &CmdAddBalance{
|
||||
name: "add_balance",
|
||||
rpcMethod: "ApierV1.AddBalance",
|
||||
rpcParams: &apier.AttrAddBalance{BalanceType: engine.CREDIT},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -51,6 +50,9 @@ func (self *CmdAddBalance) RpcMethod() string {
|
||||
}
|
||||
|
||||
func (self *CmdAddBalance) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &apier.AttrAddBalance{BalanceType: engine.CREDIT}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
|
||||
58
console/add_triggeredaction.go
Normal file
58
console/add_triggeredaction.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/apier"
|
||||
|
||||
func init() {
|
||||
c := &CmdAddTriggeredAction{
|
||||
name: "add_triggeredaction",
|
||||
rpcMethod: "ApierV1.AddTriggeredAction",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdAddTriggeredAction struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *apier.AttrAddActionTrigger
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdAddTriggeredAction) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdAddTriggeredAction) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdAddTriggeredAction) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &apier.AttrAddActionTrigger{Direction: "*out"}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdAddTriggeredAction) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
|
||||
65
console/debit_balance.go
Normal file
65
console/debit_balance.go
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/engine"
|
||||
|
||||
func init() {
|
||||
c := &CmdDebitBalance{
|
||||
name: "debit_balance",
|
||||
rpcMethod: "Responder.Debit",
|
||||
rpcParams: &engine.CallDescriptor{Direction: "*out"},
|
||||
clientArgs: []string{"Direction", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdDebitBalance struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *engine.CallDescriptor
|
||||
rpcResult string
|
||||
clientArgs []string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdDebitBalance) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdDebitBalance) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdDebitBalance) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &engine.CallDescriptor{Direction: "*out"}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdDebitBalance) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
|
||||
func (self *CmdDebitBalance) ClientArgs() []string {
|
||||
return self.clientArgs
|
||||
}
|
||||
59
console/execute_action.go
Normal file
59
console/execute_action.go
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/apier"
|
||||
|
||||
func init() {
|
||||
c := &CmdExecuteAction{
|
||||
name: "execute_action",
|
||||
rpcMethod: "ApierV1.ExecuteAction",
|
||||
rpcParams: &apier.AttrExecuteAction{Direction: "*out"},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdExecuteAction struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *apier.AttrExecuteAction
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdExecuteAction) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdExecuteAction) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdExecuteAction) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &apier.AttrExecuteAction{Direction: "*out"}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdExecuteAction) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
58
console/export_cdrs.go
Normal file
58
console/export_cdrs.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdExportCdrs{
|
||||
name: "export_cdrs",
|
||||
rpcMethod: "ApierV1.ExportCdrsToFile",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdExportCdrs struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.AttrExpFileCdrs
|
||||
rpcResult utils.ExportedFileCdrs
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdExportCdrs) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdExportCdrs) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdExportCdrs) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.AttrExpFileCdrs{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdExportCdrs) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
62
console/get_account.go
Normal file
62
console/get_account.go
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/apier"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetAccount{
|
||||
name: "get_account",
|
||||
rpcMethod: "ApierV1.GetAccount",
|
||||
rpcParams: &apier.AttrGetAccount{Direction: "*out"},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetAccount struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *apier.AttrGetAccount
|
||||
rpcResult *engine.CallCost
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetAccount) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetAccount) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetAccount) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &apier.AttrGetAccount{Direction: "*out"}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetAccount) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
55
console/get_cache_age.go
Normal file
55
console/get_cache_age.go
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdGetCacheAge{
|
||||
name: "get_cache_age",
|
||||
rpcMethod: "ApierV1.GetCachedItemAge",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetCacheAge struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams string
|
||||
rpcResult *utils.CachedItemAge
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheAge) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheAge) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheAge) RpcParams() interface{} {
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheAge) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
58
console/get_cache_stats.go
Normal file
58
console/get_cache_stats.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdGetCacheStats{
|
||||
name: "get_cache_stats",
|
||||
rpcMethod: "ApierV1.GetCachedStats",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetCacheStats struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.AttrCacheStats
|
||||
rpcResult utils.CacheStats
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheStats) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheStats) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheStats) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.AttrCacheStats{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetCacheStats) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
61
console/get_callcost.go
Normal file
61
console/get_callcost.go
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/apier"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetCallCost{
|
||||
name: "get_callcost",
|
||||
rpcMethod: "ApierV1.GetCallCostLog",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetCallCost struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *apier.AttrGetCallCost
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetCallCost) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetCallCost) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetCallCost) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &apier.AttrGetCallCost{RunId: utils.DEFAULT_RUNID}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetCallCost) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
61
console/get_destination.go
Normal file
61
console/get_destination.go
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDestination{
|
||||
name: "get_destination",
|
||||
rpcMethod: "ApierV1.GetDestination",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDestination struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.AttrGetDestination
|
||||
rpcResult engine.Destination
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDestination) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDestination) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDestination) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.AttrGetDestination{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDestination) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
64
console/get_maxduration.go
Normal file
64
console/get_maxduration.go
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/engine"
|
||||
|
||||
func init() {
|
||||
c := &CmdGetMaxDuration{
|
||||
name: "get_maxduration",
|
||||
rpcMethod: "Responder.GetMaxSessionTime",
|
||||
clientArgs: []string{"Direction", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetMaxDuration struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *engine.CallDescriptor
|
||||
rpcResult *float64
|
||||
clientArgs []string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetMaxDuration) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetMaxDuration) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetMaxDuration) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &engine.CallDescriptor{Direction: "*out"}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetMaxDuration) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
|
||||
func (self *CmdGetMaxDuration) ClientArgs() []string {
|
||||
return self.clientArgs
|
||||
}
|
||||
58
console/reload_cache.go
Normal file
58
console/reload_cache.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdReloadCache{
|
||||
name: "reload_cache",
|
||||
rpcMethod: "ApierV1.ReloadCache",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdReloadCache struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.ApiReloadCache
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdReloadCache) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdReloadCache) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdReloadCache) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.ApiReloadCache{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdReloadCache) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
56
console/reload_scheduler.go
Normal file
56
console/reload_scheduler.go
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
func init() {
|
||||
c := &CmdReloadScheduler{
|
||||
name: "reload_scheduler",
|
||||
rpcMethod: "ApierV1.ReloadScheduler",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdReloadScheduler struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams string
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdReloadScheduler) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdReloadScheduler) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdReloadScheduler) RpcParams() interface{} {
|
||||
/*if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.ApiReloadCache{}
|
||||
}*/
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdReloadScheduler) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
58
console/rem_cdrs.go
Normal file
58
console/rem_cdrs.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdRemCdrs{
|
||||
name: "rem_cdrs",
|
||||
rpcMethod: "ApierV1.RemCdrs",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdRemCdrs struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.AttrRemCdrs
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdRemCdrs) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdRemCdrs) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdRemCdrs) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.AttrRemCdrs{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdRemCdrs) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
58
console/set_accountactions.go
Normal file
58
console/set_accountactions.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdSetAccountActions{
|
||||
name: "set_accountactions",
|
||||
rpcMethod: "ApierV1.SetAccountActions",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdSetAccountActions struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.TPAccountActions
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdSetAccountActions) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdSetAccountActions) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdSetAccountActions) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.TPAccountActions{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdSetAccountActions) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
58
console/set_ratingprofile.go
Normal file
58
console/set_ratingprofile.go
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Rating system designed to be used in VoIP Carriers World
|
||||
Copyright (C) 2013 ITsysCOM
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import "github.com/cgrates/cgrates/utils"
|
||||
|
||||
func init() {
|
||||
c := &CmdSetRatingProfile{
|
||||
name: "set_ratingprofilet",
|
||||
rpcMethod: "ApierV1.SetRatingProfile",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdSetRatingProfile struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.TPRatingProfile
|
||||
rpcResult string
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdSetRatingProfile) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdSetRatingProfile) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdSetRatingProfile) RpcParams() interface{} {
|
||||
if self.rpcParams == nil {
|
||||
self.rpcParams = &utils.TPRatingProfile{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdSetRatingProfile) RpcResult() interface{} {
|
||||
return &self.rpcResult
|
||||
}
|
||||
@@ -370,3 +370,7 @@ type AttrLoadTpFromFolder struct {
|
||||
DryRun bool // Do not write to database but parse only
|
||||
FlushDb bool // Flush previous data before loading new one
|
||||
}
|
||||
|
||||
type AttrGetDestination struct {
|
||||
Id string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user