mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 06:09:53 +05:00
Replaced DEFAULT_RUNID with META_DEFAULT
This commit is contained in:
@@ -207,8 +207,8 @@ func cdrLogAction(acc *Account, a *Action, acs Actions, extraData interface{}) (
|
||||
if err := connMgr.Call(config.CgrConfig().SchedulerCfg().CDRsConns, nil,
|
||||
utils.CDRsV1ProcessEvent,
|
||||
&ArgV1ProcessEvent{
|
||||
Flags: []string{utils.ConcatenatedKey(utils.MetaChargers, "false")}, // do not try to get the chargers for cdrlog
|
||||
CGREvent: *cdr.AsCGREvent()}, &rply); err != nil {
|
||||
Flags: []string{utils.ConcatenatedKey(utils.MetaChargers, "false")}, // do not try to get the chargers for cdrlog
|
||||
CGREvent: *cdr.AsCGREvent()}, &rply); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestHttpJsonPost(t *testing.T) {
|
||||
Source: utils.UNIT_TEST, RequestType: utils.META_RATED, Tenant: "cgrates.org",
|
||||
Category: "call", Account: "account1", Subject: "tgooiscs0014", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC).String(), AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String(),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: "0.00000001", ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, Cost: 1.01,
|
||||
}
|
||||
jsn, _ := json.Marshal(cdrOut)
|
||||
|
||||
@@ -34,13 +34,13 @@ func TestNewCDRFromExternalCDR(t *testing.T) {
|
||||
OrderID: 123, ToR: utils.VOICE, OriginID: "dsafdsaf", OriginHost: "192.168.1.1",
|
||||
Source: utils.UNIT_TEST, RequestType: utils.META_RATED,
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002",
|
||||
SetupTime: "2013-11-07T08:42:20Z", AnswerTime: "2013-11-07T08:42:26Z", RunID: utils.DEFAULT_RUNID,
|
||||
SetupTime: "2013-11-07T08:42:20Z", AnswerTime: "2013-11-07T08:42:26Z", RunID: utils.META_DEFAULT,
|
||||
Usage: "10", Cost: 1.01, PreRated: true,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
}
|
||||
eStorCdr := &CDR{CGRID: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC).String()),
|
||||
OrderID: 123, ToR: utils.VOICE, OriginID: "dsafdsaf", OriginHost: "192.168.1.1",
|
||||
Source: utils.UNIT_TEST, RequestType: utils.META_RATED, RunID: utils.DEFAULT_RUNID,
|
||||
Source: utils.UNIT_TEST, RequestType: utils.META_RATED, RunID: utils.META_DEFAULT,
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001",
|
||||
Subject: "1001", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
@@ -62,7 +62,7 @@ func TestCDRClone(t *testing.T) {
|
||||
Category: "call", Account: "1001", Subject: "1001", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID, Usage: time.Duration(10),
|
||||
RunID: utils.META_DEFAULT, Usage: time.Duration(10),
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
Cost: 1.01, PreRated: true,
|
||||
}
|
||||
@@ -77,7 +77,7 @@ func TestFieldAsString(t *testing.T) {
|
||||
OriginHost: "192.168.1.1", Source: "test", RequestType: utils.META_RATED,
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001",
|
||||
Destination: "1002", SetupTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.DEFAULT_RUNID,
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
}
|
||||
@@ -222,7 +222,7 @@ func TestFieldsAsString(t *testing.T) {
|
||||
Category: "call", Account: "1001", Subject: "1001", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID, Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.META_DEFAULT, Usage: time.Duration(10) * time.Second,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, Cost: 1.01,
|
||||
}
|
||||
eVal := "call_from_1001"
|
||||
@@ -333,7 +333,7 @@ func TestCDRAsHttpForm(t *testing.T) {
|
||||
storCdr := CDR{CGRID: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String()), OrderID: 123, ToR: utils.VOICE, OriginID: "dsafdsaf",
|
||||
OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.META_RATED, Direction: "*out",
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC), AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.DEFAULT_RUNID,
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC), AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second, Supplier: "SUPPL1",
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, Cost: 1.01,
|
||||
}
|
||||
@@ -399,14 +399,14 @@ func TestCDRAsExternalCDR(t *testing.T) {
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID, Usage: time.Duration(10 * time.Second), Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Usage: time.Duration(10 * time.Second), Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}
|
||||
expectOutCdr := &ExternalCDR{
|
||||
CGRID: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC).String()),
|
||||
OrderID: 123, ToR: utils.VOICE, OriginID: "dsafdsaf", OriginHost: "192.168.1.1",
|
||||
Source: utils.UNIT_TEST, RequestType: utils.META_RATED,
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002",
|
||||
SetupTime: "2013-11-07T08:42:20Z", AnswerTime: "2013-11-07T08:42:26Z", RunID: utils.DEFAULT_RUNID,
|
||||
SetupTime: "2013-11-07T08:42:20Z", AnswerTime: "2013-11-07T08:42:26Z", RunID: utils.META_DEFAULT,
|
||||
Usage: "10s", Cost: 1.01, CostDetails: "null",
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}
|
||||
if cdrOut := storCdr.AsExternalCDR(); !reflect.DeepEqual(expectOutCdr, cdrOut) {
|
||||
@@ -532,7 +532,7 @@ func TestCDRAsMapStringIface(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
Cost: 1.01,
|
||||
@@ -542,7 +542,7 @@ func TestCDRAsMapStringIface(t *testing.T) {
|
||||
"field_extr1": "val_extr1",
|
||||
"fieldextr2": "valextr2",
|
||||
utils.CGRID: cdr.CGRID,
|
||||
utils.RunID: utils.DEFAULT_RUNID,
|
||||
utils.RunID: utils.META_DEFAULT,
|
||||
utils.OrderID: cdr.OrderID,
|
||||
utils.OriginHost: "192.168.1.1",
|
||||
utils.Source: utils.UNIT_TEST,
|
||||
@@ -594,7 +594,7 @@ func TestCDRTestCDRAsMapStringIface2(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
Cost: 1.01,
|
||||
@@ -607,7 +607,7 @@ func TestCDRTestCDRAsMapStringIface2(t *testing.T) {
|
||||
"field_extr1": "val_extr1",
|
||||
"fieldextr2": "valextr2",
|
||||
utils.CGRID: cdr.CGRID,
|
||||
utils.RunID: utils.DEFAULT_RUNID,
|
||||
utils.RunID: utils.META_DEFAULT,
|
||||
utils.OrderID: cdr.OrderID,
|
||||
utils.OriginHost: "192.168.1.1",
|
||||
utils.Source: utils.UNIT_TEST,
|
||||
@@ -671,7 +671,7 @@ func TestCDRAsExportRecord(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"stop_time": "2014-06-11 19:19:00 +0000 UTC", "fieldextr2": "valextr2"},
|
||||
CostDetails: eventCost,
|
||||
}
|
||||
@@ -795,7 +795,7 @@ func TestCDRAsExportMap(t *testing.T) {
|
||||
Tenant: "cgrates.org", Category: "call", Account: "1001",
|
||||
Subject: "1001", Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.DEFAULT_RUNID,
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
}
|
||||
@@ -834,7 +834,7 @@ func TestCDRAsCDRsql(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
@@ -904,7 +904,7 @@ func TestCDRNewCDRFromSQL(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
@@ -934,7 +934,7 @@ func TestCDRAsCGREvent(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
@@ -998,7 +998,7 @@ func TestCDRUpdateFromCGREvent(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
@@ -1049,7 +1049,7 @@ func TestCDRUpdateFromCGREvent(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 23, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(13) * time.Second,
|
||||
Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
@@ -1124,7 +1124,7 @@ func TestCDRexportFieldValue(t *testing.T) {
|
||||
Destination: "+4986517174963",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
Cost: 1.01,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestCsvCdrWriter(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -77,7 +77,7 @@ func TestAlternativeFieldSeparator(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -147,7 +147,7 @@ func TestExportVoiceWithConvert(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -159,7 +159,7 @@ func TestExportVoiceWithConvert(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Nanosecond,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 0.012,
|
||||
RunID: utils.META_DEFAULT, Cost: 0.012,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -171,7 +171,7 @@ func TestExportVoiceWithConvert(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(1),
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 0.15,
|
||||
RunID: utils.META_DEFAULT, Cost: 0.15,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -244,7 +244,7 @@ func TestExportWithFilter(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -256,7 +256,7 @@ func TestExportWithFilter(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Nanosecond,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 0.012,
|
||||
RunID: utils.META_DEFAULT, Cost: 0.012,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -268,7 +268,7 @@ func TestExportWithFilter(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(1),
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 0.15,
|
||||
RunID: utils.META_DEFAULT, Cost: 0.15,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -340,7 +340,7 @@ func TestExportWithFilter2(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.01,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.01,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -352,7 +352,7 @@ func TestExportWithFilter2(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(10) * time.Nanosecond,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 0.012,
|
||||
RunID: utils.META_DEFAULT, Cost: 0.012,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
@@ -364,7 +364,7 @@ func TestExportWithFilter2(t *testing.T) {
|
||||
SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
Usage: time.Duration(1),
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 0.15,
|
||||
RunID: utils.META_DEFAULT, Cost: 0.15,
|
||||
ExtraFields: map[string]string{"extra1": "val_extra1",
|
||||
"extra2": "val_extra2", "extra3": "val_extra3"},
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ func TestWriteCdr(t *testing.T) {
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
Usage: time.Duration(10) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 2.34567,
|
||||
RunID: utils.META_DEFAULT, Cost: 2.34567,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ func TestWriteCdrs(t *testing.T) {
|
||||
Category: "call", Account: "1001", Subject: "1001", Destination: "1010",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
Usage: time.Duration(10) * time.Second, RunID: utils.DEFAULT_RUNID, Cost: 2.25,
|
||||
Usage: time.Duration(10) * time.Second, RunID: utils.META_DEFAULT, Cost: 2.25,
|
||||
ExtraFields: map[string]string{"productnumber": "12341", "fieldextr2": "valextr2"},
|
||||
}
|
||||
cdr2 := &CDR{CGRID: utils.Sha1("aaa2", time.Date(2013, 11, 7, 7, 42, 20, 0, time.UTC).String()),
|
||||
@@ -353,7 +353,7 @@ func TestWriteCdrs(t *testing.T) {
|
||||
SetupTime: time.Date(2013, 11, 7, 7, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 7, 42, 26, 0, time.UTC),
|
||||
Usage: time.Duration(5) * time.Minute,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 1.40001,
|
||||
RunID: utils.META_DEFAULT, Cost: 1.40001,
|
||||
ExtraFields: map[string]string{"productnumber": "12342", "fieldextr2": "valextr2"},
|
||||
}
|
||||
cdr3 := &CDR{}
|
||||
@@ -364,7 +364,7 @@ func TestWriteCdrs(t *testing.T) {
|
||||
SetupTime: time.Date(2013, 11, 7, 9, 42, 18, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 9, 42, 26, 0, time.UTC),
|
||||
Usage: time.Duration(20) * time.Second,
|
||||
RunID: utils.DEFAULT_RUNID, Cost: 2.34567,
|
||||
RunID: utils.META_DEFAULT, Cost: 2.34567,
|
||||
ExtraFields: map[string]string{"productnumber": "12344", "fieldextr2": "valextr2"},
|
||||
}
|
||||
cfg, _ := config.NewDefaultCGRConfig()
|
||||
|
||||
@@ -562,7 +562,7 @@ func testGetCDRs(cfg *config.CGRConfig) error {
|
||||
return fmt.Errorf("testGetCDRs #21, unexpected count of CDRs returned: %d", count)
|
||||
}
|
||||
// Filter on RunID
|
||||
if CDRs, _, err := cdrStorage.GetCDRs(&utils.CDRsFilter{RunIDs: []string{utils.DEFAULT_RUNID}}, false); err != nil {
|
||||
if CDRs, _, err := cdrStorage.GetCDRs(&utils.CDRsFilter{RunIDs: []string{utils.META_DEFAULT}}, false); err != nil {
|
||||
return fmt.Errorf("testGetCDRs #22 err: %v", err)
|
||||
} else if len(CDRs) != 5 {
|
||||
return fmt.Errorf("testGetCDRs #23, unexpected number of CDRs returned: %+v", CDRs)
|
||||
|
||||
@@ -36,7 +36,7 @@ func TestNewSureTaxRequest(t *testing.T) {
|
||||
Subject: "1001", Destination: "1002",
|
||||
SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC),
|
||||
AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
RunID: utils.DEFAULT_RUNID,
|
||||
RunID: utils.META_DEFAULT,
|
||||
Usage: time.Duration(12) * time.Second,
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
Cost: 1.01, PreRated: true,
|
||||
|
||||
Reference in New Issue
Block a user