From a1dc0c2e89054053d8adba7a5239f1a4fed49667 Mon Sep 17 00:00:00 2001 From: JungJun Date: Wed, 20 Jul 2022 17:45:26 +0900 Subject: [PATCH] =?UTF-8?q?timesleep=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- icsconf/icsconf.go | 6 ++++++ icshttp/handler.go | 4 ++++ 2 files changed, 10 insertions(+) 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))