Updated refundEventCost

This commit is contained in:
Trial97
2019-12-09 18:04:01 +02:00
parent b4fe82c6d7
commit 4bcafed33f
3 changed files with 5 additions and 2 deletions

View File

@@ -289,6 +289,9 @@ func (cdrS *CDRServer) rateCDRWithErr(cdr *CDRWithArgDispatcher) (ratedCDRs []*C
// refundEventCost will refund the EventCost using RefundIncrements
func (cdrS *CDRServer) refundEventCost(ec *EventCost, reqType, tor string) (err error) {
if cdrS.rals == nil {
return utils.NewErrNotConnected(utils.RALService)
}
if ec == nil || !utils.AccountableRequestTypes.Has(reqType) {
return // non refundable
}
@@ -754,7 +757,6 @@ func (cdrS *CDRServer) V1ProcessEvent(arg *ArgV1ProcessEvent, reply *string) (er
chrgS = flgs.GetBool(utils.MetaChargers)
}
var ralS bool // activate single rating for the CDR
fmt.Printf("flags: %s HasKeyRALs: %v\n", utils.ToIJSON(flgs), flgs.GetBool(utils.MetaRALs))
if flgs.HasKey(utils.MetaRALs) {
ralS = flgs.GetBool(utils.MetaRALs)
}

View File

@@ -2627,6 +2627,7 @@ func (sS *SessionS) BiRPCv1ProcessCDR(clnt rpcclient.ClientConnector,
} else { // no cached session, CDR will be handled by CDRs
return sS.cdrS.Call(utils.CDRsV1ProcessEvent,
&engine.ArgV1ProcessEvent{
Flags: []string{utils.MetaRALs},
CGREvent: *cgrEvWithArgDisp.CGREvent,
ArgDispatcher: cgrEvWithArgDisp.ArgDispatcher}, rply)
}

View File

@@ -976,7 +976,7 @@ func TestSessionsDataTTLUsageProtection(t *testing.T) {
time.Sleep(60 * time.Millisecond)
if err := sDataRPC.Call(utils.SessionSv1GetActiveSessions,
new(utils.SessionFilter), &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
t.Error(err, aSessions)
t.Error(err, utils.ToJSON(aSessions))
}
}