mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 13:19:53 +05:00
Add better logs when start diffent Agents
This commit is contained in:
committed by
Dan Christian Bogos
parent
01e7003331
commit
5e7b648012
@@ -97,6 +97,8 @@ func (sma *AsteriskAgent) ListenAndServe() (err error) {
|
||||
if err = sma.connectAsterisk(); err != nil {
|
||||
return
|
||||
}
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> successfully connected to Asterisk at: <%s>",
|
||||
utils.AsteriskAgent, sma.cgrCfg.AsteriskAgentCfg().AsteriskConns[sma.astConnIdx].Address))
|
||||
for {
|
||||
select {
|
||||
case err = <-sma.astErrChan:
|
||||
|
||||
@@ -79,6 +79,7 @@ func (self *KamailioAgent) Connect() (err error) {
|
||||
if self.conns[connIdx], err = kamevapi.NewKamEvapi(connCfg.Address, connIdx, connCfg.Reconnects, eventHandlers, logger); err != nil {
|
||||
return
|
||||
}
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> successfully connected to Kamailio at: <%s>", utils.KamAgentCfg, connCfg.Address))
|
||||
go func(conn *kamevapi.KamEvapi) { // Start reading in own goroutine, return on error
|
||||
if err := conn.ReadEvents(); err != nil {
|
||||
errChan <- err
|
||||
|
||||
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package services
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/cgrates/cgrates/agents"
|
||||
@@ -61,7 +62,7 @@ func (ha *HTTPAgent) Start() (err error) {
|
||||
|
||||
ha.Lock()
|
||||
defer ha.Unlock()
|
||||
utils.Logger.Info("Starting HTTP agent")
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> successfully started HTTPAgent", utils.HttpAgentCfg))
|
||||
for _, agntCfg := range ha.cfg.HttpAgentCfg() {
|
||||
ha.server.RegisterHttpHandler(agntCfg.Url,
|
||||
agents.NewHTTPAgent(ha.connMgr, agntCfg.SessionSConns, filterS,
|
||||
|
||||
Reference in New Issue
Block a user