diff --git a/engine/action.go b/engine/action.go index 8aeeb5676..35834d55b 100644 --- a/engine/action.go +++ b/engine/action.go @@ -22,7 +22,6 @@ import ( "encoding/json" "errors" "fmt" - "log" "net/smtp" "path" "reflect" @@ -680,12 +679,10 @@ func cgrRPCAction(account *Account, sq *StatsQueueTriggered, a *Action, acs Acti } in, out := params.InParam, params.OutParam - log.Print("IN: ", reflect.TypeOf(in)) - log.Print(req.Param) - if err := json.Unmarshal([]byte(req.Param), &in); err != nil { + x := in + if err := json.Unmarshal([]byte(req.Param), &x); err != nil { return err } - log.Print("IN: ", reflect.TypeOf(in)) return client.Call(req.Method, in, out) } diff --git a/utils/rpc_params.go b/utils/rpc_params.go index 21a4aa5f4..9eaecba1a 100644 --- a/utils/rpc_params.go +++ b/utils/rpc_params.go @@ -33,7 +33,7 @@ func RegisterRpcParams(name string, obj rpcclient.RpcClientConnection) { if methodType.NumIn() == 3 { // if it has three parameters (one is self and two are rpc params) rpcParamsMap[name+"."+method.Name] = &RpcParams{ Object: obj, - InParam: reflect.Zero(methodType.In(1)).Interface(), + InParam: (reflect.New(methodType.In(1)).Elem()).Interface(), OutParam: reflect.New(methodType.In(2).Elem()).Interface(), } }