renamed Param to params

This commit is contained in:
Radu Ioan Fericean
2016-04-21 15:16:13 +03:00
parent aa28ef31ce
commit 4f399e7683
3 changed files with 4 additions and 4 deletions

View File

@@ -9,4 +9,4 @@ TOPUP_DATA_r,*topup,,,,*monetary,*out,,DATA_DEST,,,*unlimited,,5000000,10,false,
TOPUP_DATA_r,*topup,,,,*data,*out,,DATA_DEST,datar,,*unlimited,,50000000000,10,false,false,10
TOPUP_VOICE,*topup,,,,*voice,*out,,GERMANY_MOBILE,,,*unlimited,,50000,10,false,false,10
TOPUP_NEG,*topup,,,,*voice,*out,,GERMANY;!GERMANY_MOBILE,*zero1m,,*unlimited,,100,10,false,false,10
RPC,*cgr_rpc,"{""Address"": ""localhost:2013"",""Transport"":""*gob"",""Method"":""ApierV2.SetAccount"",""Attempts"":1,""Async"" :false,""Param"":{""Account"":""rpc"",""Tenant"":""cgrates.org""}}",,,,,,,,,,,,,,,
RPC,*cgr_rpc,"{""Address"": ""localhost:2013"",""Transport"":""*gob"",""Method"":""ApierV2.SetAccount"",""Attempts"":1,""Async"" :false,""Params"":{""Account"":""rpc"",""Tenant"":""cgrates.org""}}",,,,,,,,,,,,,,,
1 #ActionsTag[0] Action[1] ActionExtraParameters[2] Filter[3] BalanceTag[4] BalanceType[5] Directions[6] Categories[7] DestinationIds[8] RatingSubject[9] SharedGroup[10] ExpiryTime[11] TimingTags[12] Units[13] BalanceWeight[14] BalanceBlocker[15] BalanceDisabled[16] Weight[17]
9 TOPUP_DATA_r *topup *data *out DATA_DEST datar *unlimited 50000000000 10 false false 10
10 TOPUP_VOICE *topup *voice *out GERMANY_MOBILE *unlimited 50000 10 false false 10
11 TOPUP_NEG *topup *voice *out GERMANY;!GERMANY_MOBILE *zero1m *unlimited 100 10 false false 10
12 RPC *cgr_rpc {"Address": "localhost:2013","Transport":"*gob","Method":"ApierV2.SetAccount","Attempts":1,"Async" :false,"Param":{"Account":"rpc","Tenant":"cgrates.org"}} {"Address": "localhost:2013","Transport":"*gob","Method":"ApierV2.SetAccount","Attempts":1,"Async" :false,"Params":{"Account":"rpc","Tenant":"cgrates.org"}}

View File

@@ -657,7 +657,7 @@ type RPCRequest struct {
Method string
Attempts int
Async bool
Param map[string]interface{}
Params map[string]interface{}
}
func cgrRPCAction(account *Account, sq *StatsQueueTriggered, a *Action, acs Actions) error {
@@ -678,7 +678,7 @@ func cgrRPCAction(account *Account, sq *StatsQueueTriggered, a *Action, acs Acti
client = params.Object.(rpcclient.RpcClientConnection)
}
in, out := params.InParam, params.OutParam
p, err := utils.FromMapStringInterfaceValue(req.Param, in)
p, err := utils.FromMapStringInterfaceValue(req.Params, in)
if err != nil {
return err
}

View File

@@ -2212,7 +2212,7 @@ func TestCgrRpcAction(t *testing.T) {
"Method": "TestRPCParameters.Hopa",
"Attempts":1,
"Async" :false,
"Param": {"Name":"n", "Surname":"s", "Age":10.2}}`,
"Params": {"Name":"n", "Surname":"s", "Age":10.2}}`,
}
if err := cgrRPCAction(nil, nil, a, nil); err != nil {
t.Error("error executing cgr action: ", err)