timesleep 추가

main
JungJun 2 years ago
parent e87119ab68
commit a1dc0c2e89

@ -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"`

@ -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))

Loading…
Cancel
Save