diff --git a/sessionmanager/fssessionmanager.go b/sessionmanager/fssessionmanager.go index 9a15bfc23..403a0676b 100644 --- a/sessionmanager/fssessionmanager.go +++ b/sessionmanager/fssessionmanager.go @@ -23,6 +23,7 @@ import ( "fmt" "log" "net" + "time" ) // The freeswitch session manager type holding a buffer for the network connection, @@ -63,6 +64,9 @@ func (sm *FSSessionManager) readNextEvent() (ev Event) { body, err := sm.buf.ReadString('}') if err != nil { log.Print("Could not read from freeswitch connection!") + // wait until retrying to read + // TODO: maybe kill the manager? + time.Sleep(5 * time.Second) } ev = new(FSEvent).New(body) switch ev.GetName() { diff --git a/sessionmanager/sessiondelegate.go b/sessionmanager/sessiondelegate.go index 10625d157..ba82bce81 100644 --- a/sessionmanager/sessiondelegate.go +++ b/sessionmanager/sessiondelegate.go @@ -19,9 +19,9 @@ along with this program. If not, see package sessionmanager import ( + "github.com/cgrates/cgrates/balancer" "github.com/cgrates/cgrates/timespans" "log" - "github.com/cgrates/cgrates/balancer" "net/rpc" "time" )