From e1c174bebb86d495a66c481697055667e99f99f2 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Thu, 17 Apr 2014 13:10:43 +0300 Subject: [PATCH] small fix --- console/get_cost.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/console/get_cost.go b/console/get_cost.go index 768d1ad6a..7dce5465a 100644 --- a/console/get_cost.go +++ b/console/get_cost.go @@ -28,7 +28,6 @@ import ( func init() { commands["get_cost"] = &CmdGetCost{ rpcMethod: "Responder.GetCost", - rpcParams: &engine.CallDescriptor{Direction: "*out"}, clientArgs: []string{"Direction", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"}, } } @@ -42,7 +41,7 @@ type CmdGetCost struct { } func (self *CmdGetCost) Usage() string { - jsn, _ := json.Marshal(self.rpcParams) + jsn, _ := json.Marshal(engine.CallDescriptor{Direction: "*out"}) return "\n\tUsage: get_cost " + FromJSON(jsn, self.clientArgs) + "\n" } @@ -51,6 +50,9 @@ func (self *CmdGetCost) FromArgs(args string, verbose bool) error { if len(args) == 0 { return fmt.Errorf(self.Usage()) } + // defaults + self.rpcParams = &engine.CallDescriptor{Direction: "*out"} + if err := json.Unmarshal(ToJSON(args), &self.rpcParams); err != nil { return err }