dump call costs

This commit is contained in:
Radu Ioan Fericean
2012-05-16 20:33:59 +03:00
parent 5ee6aaacf8
commit 93c3df2718
2 changed files with 11 additions and 0 deletions

View File

@@ -119,10 +119,12 @@ func (sm *FSSessionManager) OnChannelHangupComplete(ev Event) {
s := sm.GetSession(ev.GetUUID())
if sm.sessionDelegate != nil {
sm.sessionDelegate.OnChannelHangupComplete(ev, s)
s.SaveMOperations()
} else {
log.Print("HangupComplete")
}
if s != nil {
s.Close()
}
}

View File

@@ -104,3 +104,12 @@ func (s *Session) Disconnect() {
func (s *Session) String() string {
return fmt.Sprintf("%v: %s -> %s", s.callDescriptor.TimeStart, s.callDescriptor.Subject, s.callDescriptor.DestinationPrefix)
}
//
func (s *Session) SaveMOperations() {
go func() {
for _, cc := range s.CallCosts {
log.Print(cc)
}
}()
}