diff --git a/cmd/cgr-console/cgr-console.go b/cmd/cgr-console/cgr-console.go index 7766b7bc6..a692adf98 100644 --- a/cmd/cgr-console/cgr-console.go +++ b/cmd/cgr-console/cgr-console.go @@ -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) diff --git a/console/add_account.go b/console/add_account.go index a11800e5e..daae7feb8 100644 --- a/console/add_account.go +++ b/console/add_account.go @@ -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 } diff --git a/console/add_balance.go b/console/add_balance.go index ffd01aeeb..c7597fc3a 100644 --- a/console/add_balance.go +++ b/console/add_balance.go @@ -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 } diff --git a/console/add_triggeredaction.go b/console/add_triggeredaction.go new file mode 100644 index 000000000..68715abc6 --- /dev/null +++ b/console/add_triggeredaction.go @@ -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 +*/ + +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 +} diff --git a/console/command.go b/console/command.go index fb2647ea9..a1a793619 100644 --- a/console/command.go +++ b/console/command.go @@ -1,4 +1,4 @@ -/* + /* Rating system designed to be used in VoIP Carriers World Copyright (C) 2013 ITsysCOM diff --git a/console/debit_balance.go b/console/debit_balance.go new file mode 100644 index 000000000..937fa1164 --- /dev/null +++ b/console/debit_balance.go @@ -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 +*/ + +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 +} diff --git a/console/execute_action.go b/console/execute_action.go new file mode 100644 index 000000000..1f1a028d9 --- /dev/null +++ b/console/execute_action.go @@ -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 +*/ + +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 +} diff --git a/console/export_cdrs.go b/console/export_cdrs.go new file mode 100644 index 000000000..d08f2bd5a --- /dev/null +++ b/console/export_cdrs.go @@ -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 +*/ + +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 +} diff --git a/console/get_account.go b/console/get_account.go new file mode 100644 index 000000000..a685da633 --- /dev/null +++ b/console/get_account.go @@ -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 +*/ + +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 +} diff --git a/console/get_cache_age.go b/console/get_cache_age.go new file mode 100644 index 000000000..43d81b831 --- /dev/null +++ b/console/get_cache_age.go @@ -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 +*/ + +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 +} diff --git a/console/get_cache_stats.go b/console/get_cache_stats.go new file mode 100644 index 000000000..e2e5add83 --- /dev/null +++ b/console/get_cache_stats.go @@ -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 +*/ + +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 +} diff --git a/console/get_callcost.go b/console/get_callcost.go new file mode 100644 index 000000000..9dbba9d91 --- /dev/null +++ b/console/get_callcost.go @@ -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 +*/ + +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 +} diff --git a/console/get_destination.go b/console/get_destination.go new file mode 100644 index 000000000..a9e9732b9 --- /dev/null +++ b/console/get_destination.go @@ -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 +*/ + +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 +} diff --git a/console/get_maxduration.go b/console/get_maxduration.go new file mode 100644 index 000000000..8d3132f15 --- /dev/null +++ b/console/get_maxduration.go @@ -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 +*/ + +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 +} diff --git a/console/reload_cache.go b/console/reload_cache.go new file mode 100644 index 000000000..e449760be --- /dev/null +++ b/console/reload_cache.go @@ -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 +*/ + +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 +} diff --git a/console/reload_scheduler.go b/console/reload_scheduler.go new file mode 100644 index 000000000..1c8899d10 --- /dev/null +++ b/console/reload_scheduler.go @@ -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 +*/ + +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 +} diff --git a/console/rem_cdrs.go b/console/rem_cdrs.go new file mode 100644 index 000000000..1b58d9e32 --- /dev/null +++ b/console/rem_cdrs.go @@ -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 +*/ + +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 +} diff --git a/console/set_accountactions.go b/console/set_accountactions.go new file mode 100644 index 000000000..d10d178f9 --- /dev/null +++ b/console/set_accountactions.go @@ -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 +*/ + +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 +} diff --git a/console/set_ratingprofile.go b/console/set_ratingprofile.go new file mode 100644 index 000000000..a9f7b2ba6 --- /dev/null +++ b/console/set_ratingprofile.go @@ -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 +*/ + +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 +} diff --git a/utils/apitpdata.go b/utils/apitpdata.go index ef2a64cef..9719c463d 100644 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -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 +}