|
|
|
@ -35,14 +35,13 @@ func Init(conf *icsconf.IcsConfig) (e *IcsExec) {
|
|
|
|
|
func (exe IcsExec) Execute() *icserror.IcsError {
|
|
|
|
|
l := icslog.GetIcsLog()
|
|
|
|
|
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_FATAL, -1, "11111")
|
|
|
|
|
for !exe.service.GetExit() {
|
|
|
|
|
for exe.service.GetStop() {
|
|
|
|
|
time.Sleep(time.Millisecond)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
//start statistic tcp
|
|
|
|
|
// voice gateway start statistic tcp
|
|
|
|
|
cmdDone := make(chan *icserror.IcsError)
|
|
|
|
|
go func() {
|
|
|
|
|
cmdErr := icsstat.ListenStatMNG()
|
|
|
|
@ -56,13 +55,34 @@ func (exe IcsExec) Execute() *icserror.IcsError {
|
|
|
|
|
}()
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
// voice agent start statistic tcp
|
|
|
|
|
cmdDone1 := make(chan *icserror.IcsError)
|
|
|
|
|
go func() {
|
|
|
|
|
cmdErr := icsstat.ListenStatMNG1()
|
|
|
|
|
if cmdErr != nil {
|
|
|
|
|
cmdDone1 <- cmdErr
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
//defer sm.Close()
|
|
|
|
|
|
|
|
|
|
//cmdDone <- nil
|
|
|
|
|
}()
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
select {
|
|
|
|
|
case err := <-cmdDone:
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Stat TCP Connection: %s", err)
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Gateway Stat TCP Connection: %s", err)
|
|
|
|
|
if err != nil {
|
|
|
|
|
//err.Print()
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
case err1 := <-cmdDone1:
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Agent Stat TCP Connection: %s", err1)
|
|
|
|
|
if err1 != nil {
|
|
|
|
|
//err.Print()
|
|
|
|
|
return err1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|