mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 14:48:43 +05:00
passing call test
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user