mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
Use CompressFactor in SessionS.Refund
This commit is contained in:
committed by
Dan Christian Bogos
parent
9214301de3
commit
65b8c56256
@@ -575,7 +575,10 @@ func (sS *SessionS) refundSession(s *Session, sRunIdx int, rUsage time.Duration)
|
||||
incr.BalanceInfo.Monetary == nil) {
|
||||
continue // not enough information for refunds, most probably free units uncounted
|
||||
}
|
||||
incrmts = append(incrmts, incr)
|
||||
for i := 0; i < tmspn.CompressFactor; i++ {
|
||||
incrmts = append(incrmts, incr)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
cd := &engine.CallDescriptor{
|
||||
|
||||
@@ -873,14 +873,13 @@ func TestSessionsVoiceSessionTTL(t *testing.T) {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.MONETARY].GetTotalValue())
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
eAcntVal = 4.0565
|
||||
eAcntVal = 4.0566
|
||||
if err := sessionsRPC.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.MONETARY].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.MONETARY].GetTotalValue())
|
||||
}
|
||||
|
||||
time.Sleep(time.Duration(500 * time.Millisecond))
|
||||
var cdrs []*engine.ExternalCDR
|
||||
req := utils.RPCCDRsFilter{RunIDs: []string{utils.META_DEFAULT}, DestinationPrefixes: []string{"1008"}}
|
||||
if err := sessionsRPC.Call(utils.ApierV2GetCDRs, req, &cdrs); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user