Added KamailioAgent as service in ServiceManager

This commit is contained in:
Trial97
2019-09-30 17:28:24 +03:00
committed by Dan Christian Bogos
parent e1b0b65730
commit 1f106a62ce
7 changed files with 224 additions and 66 deletions

View File

@@ -286,6 +286,9 @@ func (srvMngr *ServiceManager) StartServices() (err error) {
if srvMngr.GetConfig().FsAgentCfg().Enabled {
go srvMngr.startService(utils.FreeSWITCHAgent)
}
if srvMngr.GetConfig().KamAgentCfg().Enabled {
go srvMngr.startService(utils.KamailioAgent)
}
// startServer()
return
}
@@ -370,6 +373,10 @@ func (srvMngr *ServiceManager) handleReload() {
if err = srvMngr.reloadService(utils.FreeSWITCHAgent, srvMngr.GetConfig().FsAgentCfg().Enabled); err != nil {
return
}
case <-srvMngr.GetConfig().GetReloadChan(config.KamailioAgentJSN):
if err = srvMngr.reloadService(utils.KamailioAgent, srvMngr.GetConfig().KamAgentCfg().Enabled); err != nil {
return
}
}
// handle RPC server
}