Update calls test for kamailio

This commit is contained in:
TeoV
2018-06-21 09:20:55 -04:00
committed by Dan Christian Bogos
parent 3478b74c7e
commit 3a42359d08
6 changed files with 17 additions and 11 deletions

View File

@@ -6,4 +6,10 @@ cgrates.org,ATTR_1001_SESSIONAUTH,*sessions,*string:Account:1001,,Password,*any,
cgrates.org,ATTR_1001_SESSIONAUTH,,,,RequestType,*any,*prepaid,true,
cgrates.org,ATTR_1001_SESSIONAUTH,,,,PaypalAccount,*any,cgrates@paypal.com,true,
cgrates.org,ATTR_1001_SESSIONAUTH,,,,LCRProfile,*any,premium_cli,true,
cgrates.org,ATTR_1002_SESSIONAUTH,*sessions,*string:Account:1002,,Password,*any,CGRateS.org,true,10
cgrates.org,ATTR_1002_SESSIONAUTH,,,,RequestType,*any,*postpaid,true,
cgrates.org,ATTR_1002_SESSIONAUTH,,,,PaypalAccount,*any,cgrates@paypal.com,true,
cgrates.org,ATTR_1002_SESSIONAUTH,,,,LCRProfile,*any,premium_cli,true,
cgrates.org,ATTR_1002_SESSIONAUTH,,,,ResourceAllocation,*any,"ResGroup1",true,
1 #Tenant ID Contexts FilterIDs ActivationInterval FieldName Initial Substitute Append Weight
6 cgrates.org ATTR_1001_SESSIONAUTH RequestType *any *prepaid true
7 cgrates.org ATTR_1001_SESSIONAUTH PaypalAccount *any cgrates@paypal.com true
8 cgrates.org ATTR_1001_SESSIONAUTH LCRProfile *any premium_cli true
9 cgrates.org ATTR_1002_SESSIONAUTH *sessions *string:Account:1002 Password *any CGRateS.org true 10
10 cgrates.org ATTR_1002_SESSIONAUTH RequestType *any *postpaid true
11 cgrates.org ATTR_1002_SESSIONAUTH PaypalAccount *any cgrates@paypal.com true
12 cgrates.org ATTR_1002_SESSIONAUTH LCRProfile *any premium_cli true
13 cgrates.org ATTR_1002_SESSIONAUTH ResourceAllocation *any ResGroup1 true
14
15

View File

@@ -1,11 +1,8 @@
#Tenant[0],ID[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4],ActivationInterval[5]
cgrates.org,FLTR_1,*string,Account,1001;1002,2014-07-29T15:00:00Z
cgrates.org,FLTR_1,*prefix,Destination,10;20,
cgrates.org,FLTR_1,*rsr,,Subject(~^1.*1$);Destination(1002),
cgrates.org,FLTR_DST_FS,*destinations,Destination,DST_FS,2014-07-29T15:00:00Z
cgrates.org,FLTR_RES_GR3,*string,Account,1003,2014-07-29T15:00:00Z
cgrates.org,FLTR_ACNT_1001_1002,*string,Account,1001;1002,2014-07-29T15:00:00Z
cgrates.org,FLTR_ACNT_1001_1002,*string,RunID,*default,
cgrates.org,FLTR_ACNT_1001,*string,Account,1001,2014-07-29T15:00:00Z
cgrates.org,FLTR_ACNT_1002,*string,Account,1002,2014-07-29T15:00:00Z
1 #Tenant[0] ID[1] FilterType[2] FilterFieldName[3] FilterFieldValues[4] ActivationInterval[5]
2 cgrates.org FLTR_1 *string Account 1001;1002 2014-07-29T15:00:00Z
cgrates.org FLTR_1 *prefix Destination 10;20
cgrates.org FLTR_1 *rsr Subject(~^1.*1$);Destination(1002)
3 cgrates.org FLTR_DST_FS *destinations Destination DST_FS 2014-07-29T15:00:00Z
4 cgrates.org FLTR_RES_GR3 *string Account 1003 2014-07-29T15:00:00Z
5 cgrates.org FLTR_ACNT_1001_1002 *string Account 1001;1002 2014-07-29T15:00:00Z
6 cgrates.org FLTR_ACNT_1001_1002 *string RunID *default
7 cgrates.org FLTR_ACNT_1001 *string Account 1001 2014-07-29T15:00:00Z
8 cgrates.org FLTR_ACNT_1002 *string Account 1002 2014-07-29T15:00:00Z

View File

@@ -1,3 +1,3 @@
#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],TTL[4],Limit[5],AllocationMessage[6],Blocker[7],Stored[8],Weight[9],ThresholdIDs[10]
cgrates.org,ResGroup1,FLTR_1,2014-07-29T15:00:00Z,1s,7,,false,false,20,
cgrates.org,ResGroup2,FLTR_DST_FS,2014-07-29T15:00:00Z,3600s,8,SPECIAL_1003,false,true,10,
cgrates.org,ResGroup1,FLTR_1,2014-07-29T15:00:00Z,3600s,7,,false,true,10,
cgrates.org,ResGroup2,FLTR_DST_FS,2014-07-29T15:00:00Z,3600s,8,SPECIAL_1003,false,true,10,
1 #Tenant[0] Id[1] FilterIDs[2] ActivationInterval[3] TTL[4] Limit[5] AllocationMessage[6] Blocker[7] Stored[8] Weight[9] ThresholdIDs[10]
2 cgrates.org ResGroup1 FLTR_1 2014-07-29T15:00:00Z 1s 3600s 7 false false true 20 10
3 cgrates.org ResGroup2 FLTR_DST_FS 2014-07-29T15:00:00Z 3600s 8 SPECIAL_1003 false true 10

View File

@@ -114,7 +114,7 @@ route[CGRATES_SESSIONAUTH_REQUEST] {
evapi_async_relay("{\"event\":\"CGR_AUTH_REQUEST\",
\"tr_index\":\"$T(id_index)\",
\"tr_label\":\"$T(id_label)\",
\"cgr_subsystems\":\"*attributes;*accounts;*suppliers\",
\"cgr_subsystems\":\"*attributes;*accounts;*suppliers;*resources;*thresholds\",
\"reply_route\":\"CGR_SESSIONAUTH_REPLY\",
\"Account\":\"$fU\",
\"Destination\":\"$rU\",
@@ -160,7 +160,7 @@ route[CGR_CALL_START] {
evapi_relay("{\"event\":\"CGR_CALL_START\",
\"h_entry\":\"$dlg(h_entry)\",
\"h_id\":\"$dlg(h_id)\",
\"cgr_subsystems\":\"*attributes;*accounts\",
\"cgr_subsystems\":\"*attributes;*accounts;*resources;*thresholds\",
\"OriginID\":\"$dlg_var(cgrOriginID)\",
\"RequestType\":\"$dlg_var(cgrReqType)\",
\"Tenant\":\"$dlg_var(cgrTenant)\",
@@ -178,7 +178,7 @@ route[CGR_CALL_END] {
}
$var(callDur) = $TS - $dlg(start_ts);
evapi_relay("{\"event\":\"CGR_CALL_END\",
\"cgr_subsystems\":\"*accounts\",
\"cgr_subsystems\":\"*accounts;*resources\",
\"OriginID\":\"$dlg_var(cgrOriginID)\",
\"RequestType\":\"$dlg_var(cgrReqType)\",
\"Tenant\":\"$dlg_var(cgrTenant)\",

View File

@@ -249,6 +249,11 @@ func testDspResTestAuthKey2(t *testing.T) {
},
}
eRs := &engine.Resources{
&engine.Resource{
Tenant: "cgrates.org",
ID: "ResGroup1",
Usages: map[string]*engine.ResourceUsage{},
},
&engine.Resource{
Tenant: "cgrates.org",
ID: "ResGroup2",

View File

@@ -427,8 +427,7 @@ func testCallCheckResourceAllocation(t *testing.T) {
t.Errorf("Resources: %+v", utils.ToJSON(rs))
}
for _, r := range *rs {
if r.ID == "ResGroup1" &&
(len(r.Usages) != 1 || len(r.TTLIdx) != 1) {
if r.ID == "ResGroup1" && (len(r.Usages) != 1 || len(r.TTLIdx) != 1) {
t.Errorf("Unexpected resource: %+v", utils.ToJSON(r))
}
}
@@ -589,7 +588,6 @@ func testCallSyncSessions(t *testing.T) {
}
time.Sleep(1 * time.Second)
// get active sessions
if err := tutorialCallsRpc.Call(utils.SessionSv1GetActiveSessions,
&map[string]string{}, &reply); err != nil {
t.Error("Got error on SessionSv1.GetActiveSessions: ", err.Error())