mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 22:58:44 +05:00
Add event type when CDRs send requests to other subsystems
This commit is contained in:
committed by
Dan Christian Bogos
parent
713f1d2702
commit
3882b0408d
@@ -248,7 +248,7 @@ func testAccITSetBalanceWithExtraData(t *testing.T) {
|
||||
t.Error("Unexpected error: ", err.Error())
|
||||
} else if len(cdrs) != 1 {
|
||||
t.Error("Unexpected number of CDRs returned: ", len(cdrs))
|
||||
} else if len(cdrs[0].ExtraFields) != 2 {
|
||||
} else if len(cdrs[0].ExtraFields) != 3 { // included EventType
|
||||
t.Error("Unexpected number of ExtraFields returned: ", len(cdrs[0].ExtraFields))
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ func testAccITSetBalanceWithExtraData2(t *testing.T) {
|
||||
t.Error("Unexpected error: ", err.Error())
|
||||
} else if len(cdrs) != 1 {
|
||||
t.Error("Unexpected number of CDRs returned: ", len(cdrs))
|
||||
} else if len(cdrs[0].ExtraFields) != 2 {
|
||||
} else if len(cdrs[0].ExtraFields) != 3 { // included EventType
|
||||
t.Error("Unexpected number of ExtraFields returned: ", len(cdrs[0].ExtraFields))
|
||||
} else if cdrs[0].ExtraFields["ActionVal"] != "1.5" {
|
||||
t.Error("Unexpected value of ExtraFields[ActionVal] returned: ", cdrs[0].ExtraFields["ActionVal"])
|
||||
|
||||
@@ -182,7 +182,7 @@ func testCDReProcessExternalCdr(t *testing.T) {
|
||||
SetupTime: "2014-08-04T13:00:00Z",
|
||||
AnswerTime: "2014-08-04T13:00:07Z",
|
||||
Usage: "1s",
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
ExtraFields: map[string]string{"EventType": "cdr", "field_extr1": "val_extr1", "fieldextr2": "valextr2"},
|
||||
}
|
||||
var reply string
|
||||
if err := cdreRPC.Call("CDRsV1.ProcessExternalCDR", cdr, &reply); err != nil {
|
||||
|
||||
@@ -479,6 +479,8 @@ func (cdrS *CDRServer) V1ProcessCDR(cdr *CDRWithArgDispatcher, reply *string) (e
|
||||
},
|
||||
ArgDispatcher: cdr.ArgDispatcher,
|
||||
}
|
||||
//Add event type as cdr
|
||||
cgrEv.CGREvent.Event[utils.EventType] = utils.CDRPoster
|
||||
if cdrS.attrS != nil {
|
||||
if err = cdrS.attrSProcessEvent(cgrEv); err != nil {
|
||||
err = utils.NewErrServerError(err)
|
||||
@@ -584,6 +586,8 @@ func (cdrS *CDRServer) V1ProcessEvent(arg *ArgV1ProcessEvent, reply *string) (er
|
||||
if arg.ArgDispatcher != nil {
|
||||
cgrEv.ArgDispatcher = arg.ArgDispatcher
|
||||
}
|
||||
//Add event type as event
|
||||
cgrEv.CGREvent.Event[utils.EventType] = utils.Event
|
||||
|
||||
if !ralS {
|
||||
if err = cdrS.attrStoExpThdStat(cgrEv,
|
||||
@@ -771,6 +775,8 @@ func (cdrS *CDRServer) V1RateCDRs(arg *ArgRateCDRs, reply *string) (err error) {
|
||||
CGREvent: cdr.AsCGREvent(),
|
||||
ArgDispatcher: arg.ArgDispatcher,
|
||||
}
|
||||
//Add event type as cdr
|
||||
argCharger.CGREvent.Event[utils.EventType] = utils.CDRPoster
|
||||
if err = cdrS.chrgProcessEvent(argCharger,
|
||||
false, store, export, thdS, statS); err != nil {
|
||||
return utils.NewErrServerError(err)
|
||||
|
||||
Reference in New Issue
Block a user