diff --git a/icsconf/icsconf.go b/icsconf/icsconf.go index 4e057f4..8e431cd 100644 --- a/icsconf/icsconf.go +++ b/icsconf/icsconf.go @@ -28,6 +28,7 @@ type IcsConfig struct { DtmfEndSignal DtmfEndSignal `xml:"DTMFEND"` HomeDir string ScenarioConfig ScenarioConfig `xml:"SCENARIOORDER"` + TimeSleep TimeSleep `xml:"TIMESLEEP"` } type InfoConfig struct { @@ -48,6 +49,11 @@ type DtmfEndSignal struct { Signal string `xml:"signal,attr"` } +type TimeSleep struct { + Value bool `xml:"value,attr"` + TimeSleep int `xml:"sec,attr"` +} + type VoiceConfig struct { SaveYn string `xml:"SAVEYN"` Path string `xml:"PATH"` diff --git a/icshttp/handler.go b/icshttp/handler.go index 3a63e15..1edd2fa 100644 --- a/icshttp/handler.go +++ b/icshttp/handler.go @@ -287,6 +287,10 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) { } l.Printf(icslog.LOG_LEVEL_INFO, -1, "Send Message\n %s", string(resMarshal)) + if conf.TimeSleep.Value { + time.Sleep(time.Second * time.Duration(time.Duration(conf.TimeSleep.TimeSleep))) + } + // send response fmt.Fprintln(w, string(resMarshal))