mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 07:38:45 +05:00
first real data tests
This commit is contained in:
@@ -56,6 +56,7 @@ func (dsd *DirectSessionDelegate) OnHeartBeat(ev *Event) {
|
||||
|
||||
func (dsd *DirectSessionDelegate) OnChannelAnswer(ev *Event, s *Session) {
|
||||
s.callDescriptor.Amount = DEBIT_PERIOD.Seconds()
|
||||
s.callDescriptor.SetStorageGetter(storageGetter)
|
||||
remainingSeconds, err := s.callDescriptor.GetMaxSessionTime()
|
||||
if remainingSeconds == 0 || err != nil {
|
||||
log.Print("No credit left: Disconnect!")
|
||||
@@ -70,6 +71,7 @@ func (dsd *DirectSessionDelegate) OnChannelHangupComplete(ev *Event, s *Session)
|
||||
}
|
||||
|
||||
func (dsd *DirectSessionDelegate) LoopAction(s *Session, cd *timespans.CallDescriptor) {
|
||||
cd.SetStorageGetter(storageGetter)
|
||||
cc, err := cd.Debit()
|
||||
if err != nil {
|
||||
log.Printf("Could not complete debit opperation: %v", err)
|
||||
|
||||
@@ -99,6 +99,7 @@ func (sm *SessionManager) OnHeartBeat(ev *Event) {
|
||||
func (sm *SessionManager) OnChannelAnswer(ev *Event) {
|
||||
if sm.sessionDelegate != nil {
|
||||
s := NewSession(ev, sm.sessionDelegate)
|
||||
sm.sessions = append(sm.sessions, s)
|
||||
sm.sessionDelegate.OnChannelAnswer(ev, s)
|
||||
} else {
|
||||
log.Print("answer")
|
||||
|
||||
Reference in New Issue
Block a user