mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 14:48:43 +05:00
Query costs for 0 duration prepaid calls in CDRS, fixes #290
This commit is contained in:
@@ -204,9 +204,6 @@ func (sm *FSSessionManager) onChannelHangupComplete(ev engine.Event) {
|
||||
if ev.GetReqType(utils.META_DEFAULT) == utils.META_NONE { // Do not process this request
|
||||
return
|
||||
}
|
||||
if sm.cfg.CreateCdr {
|
||||
go sm.ProcessCdr(ev.AsStoredCdr(config.CgrConfig().DefaultTimezone))
|
||||
}
|
||||
var s *Session
|
||||
for i := 0; i < 2; i++ { // Protect us against concurrency, wait a couple of seconds for the answer to be populated before we process hangup
|
||||
s = sm.sessions.getSession(ev.GetUUID())
|
||||
@@ -215,11 +212,13 @@ func (sm *FSSessionManager) onChannelHangupComplete(ev engine.Event) {
|
||||
}
|
||||
time.Sleep(time.Duration(i+1) * time.Second)
|
||||
}
|
||||
if s == nil { // Not handled by us
|
||||
return
|
||||
if s != nil { // Handled by us, cleanup here
|
||||
if err := sm.sessions.removeSession(s, ev); err != nil {
|
||||
utils.Logger.Err(err.Error())
|
||||
}
|
||||
}
|
||||
if err := sm.sessions.removeSession(s, ev); err != nil {
|
||||
utils.Logger.Err(err.Error())
|
||||
if sm.cfg.CreateCdr {
|
||||
sm.ProcessCdr(ev.AsStoredCdr(config.CgrConfig().DefaultTimezone))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user