mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Fix panic with configurations with multiple event socket connections
This commit is contained in:
@@ -76,6 +76,7 @@ information, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
|
||||
| @JDLK7 | Jose Domenech |
|
||||
| @mintos5 | Michal Škuta |
|
||||
| @playingbogart | Eugene Bozhet |
|
||||
| @htrendev | Hristo Trendev |
|
||||
|
||||
<!-- to sign, include a single line above this comment containing the following text:
|
||||
| @username | First Last |
|
||||
|
||||
@@ -297,11 +297,11 @@ func (fsa *FSsessions) Connect() error {
|
||||
}
|
||||
fsa.conns[connIdx] = fSock
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> successfully connected to FreeSWITCH at: <%s>", utils.FreeSWITCHAgent, connCfg.Address))
|
||||
go func() { // Start reading in own goroutine, return on error
|
||||
if err := fsa.conns[connIdx].ReadEvents(); err != nil {
|
||||
go func(fsock *fsock.FSock) { // Start reading in own goroutine, return on error
|
||||
if err := fsock.ReadEvents(); err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
}()
|
||||
}(fSock)
|
||||
fsSenderPool, err := fsock.NewFSockPool(5, connCfg.Address, connCfg.Password, 1, fsa.cfg.MaxWaitConnection,
|
||||
make(map[string][]func(string, int)), make(map[string][]string), utils.Logger.GetSyslog(), connIdx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user