mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
TOR in GetSessionRuns, fixes #349
This commit is contained in:
@@ -402,6 +402,7 @@ func (rs *Responder) GetSessionRuns(ev *CDR, sRuns *[]*SessionRun) error {
|
||||
}
|
||||
cd := &CallDescriptor{
|
||||
CgrId: ev.GetCgrId(rs.Timezone),
|
||||
TOR: ev.ToR,
|
||||
Direction: ev.GetDirection(dc.DirectionField),
|
||||
Tenant: ev.GetTenant(dc.TenantField),
|
||||
Category: ev.GetCategory(dc.CategoryField),
|
||||
|
||||
@@ -153,15 +153,15 @@ func TestResponderGetSessionRuns(t *testing.T) {
|
||||
&SessionRun{DerivedCharger: extra1DC,
|
||||
CallDescriptor: &CallDescriptor{CgrId: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String()), Direction: "*out", Category: "0",
|
||||
Tenant: "vdf", Subject: "rif", Account: "minitsboy", Destination: "0256", TimeStart: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}},
|
||||
TOR: utils.VOICE, ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}},
|
||||
&SessionRun{DerivedCharger: extra2DC,
|
||||
CallDescriptor: &CallDescriptor{CgrId: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String()), Direction: "*out", Category: "call",
|
||||
Tenant: "vdf", Subject: "ivo", Account: "ivo", Destination: "1002", TimeStart: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}},
|
||||
TOR: utils.VOICE, ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}},
|
||||
&SessionRun{DerivedCharger: dfDC,
|
||||
CallDescriptor: &CallDescriptor{CgrId: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String()), Direction: "*out", Category: "call",
|
||||
Tenant: "vdf", Subject: "dan2", Account: "dan2", Destination: "1002", TimeStart: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC),
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}}}
|
||||
TOR: utils.VOICE, ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}}}
|
||||
if err := rsponder.GetSessionRuns(cdr, &sesRuns); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(eSRuns, sesRuns) {
|
||||
|
||||
@@ -129,7 +129,7 @@ func TestSMGenericEventParseFields(t *testing.T) {
|
||||
func TestSMGenericEventAsStoredCdr(t *testing.T) {
|
||||
smGev := SMGenericEvent{}
|
||||
smGev[utils.EVENT_NAME] = "TEST_EVENT"
|
||||
smGev[utils.TOR] = utils.VOICE
|
||||
smGev[utils.TOR] = utils.SMS
|
||||
smGev[utils.ACCID] = "12345"
|
||||
smGev[utils.DIRECTION] = utils.OUT
|
||||
smGev[utils.ACCOUNT] = "account1"
|
||||
@@ -148,7 +148,7 @@ func TestSMGenericEventAsStoredCdr(t *testing.T) {
|
||||
smGev["Extra1"] = "Value1"
|
||||
smGev["Extra2"] = 5
|
||||
eStoredCdr := &engine.CDR{CGRID: "0711eaa78e53937f1593dabc08c83ea04a915f2e",
|
||||
ToR: utils.VOICE, OriginID: "12345", OriginHost: "10.0.3.15", Source: "SMG_TEST_EVENT", RequestType: utils.META_PREPAID,
|
||||
ToR: utils.SMS, OriginID: "12345", OriginHost: "10.0.3.15", Source: "SMG_TEST_EVENT", RequestType: utils.META_PREPAID,
|
||||
Direction: utils.OUT, Tenant: "cgrates.org", Category: "call", Account: "account1", Subject: "subject1",
|
||||
Destination: "+4986517174963", SetupTime: time.Date(2015, 11, 9, 14, 21, 24, 0, time.UTC), AnswerTime: time.Date(2015, 11, 9, 14, 22, 2, 0, time.UTC),
|
||||
Usage: time.Duration(83) * time.Second, PDD: time.Duration(300) * time.Millisecond, Supplier: "supplier1", DisconnectCause: "NORMAL_DISCONNECT",
|
||||
|
||||
Reference in New Issue
Block a user