From fccbaadf9d5ef35140c9b318f3cf9ecf110afee4 Mon Sep 17 00:00:00 2001 From: JungJun Date: Wed, 24 Aug 2022 13:11:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=A4=EC=9E=A5=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- icshttp/handler.go | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/icshttp/handler.go b/icshttp/handler.go index 183e439..b37af73 100644 --- a/icshttp/handler.go +++ b/icshttp/handler.go @@ -181,13 +181,39 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) { if conf.ExceptTest.TestInfo.Value { // eType := conf.ExceptTest.TestInfo.Type - response.ResultCode = conf.ExceptTest.TestInfo.ResultCode - response.Token = conf.ExceptTest.TestInfo.Token - response.Action = conf.ExceptTest.TestInfo.Action - response.AnounceMents = conf.ExceptTest.TestInfo.Announcement - response.Data.BargeIn = conf.ExceptTest.TestInfo.Bargein - response.Data.RecodingFile = conf.ExceptTest.TestInfo.Recodingfile - response.Data.SttMaxTime = conf.ExceptTest.TestInfo.Sttmaxtime + if request.Method != "INIT" { + response.ResultCode = conf.ExceptTest.TestInfo.ResultCode + response.Token = conf.ExceptTest.TestInfo.Token + response.Action = conf.ExceptTest.TestInfo.Action + response.AnounceMents = conf.ExceptTest.TestInfo.Announcement + response.Data.BargeIn = conf.ExceptTest.TestInfo.Bargein + response.Data.RecodingFile = conf.ExceptTest.TestInfo.Recodingfile + response.Data.SttMaxTime = conf.ExceptTest.TestInfo.Sttmaxtime + s.session[conf.ExceptTest.TestInfo.Token] = ResStatus{Count: 1, Status: scnarioConf.Order[0], NotUnderstand: 0} + } else if request.TalkText == "ERROR_TTS" || request.TalkText == "ERROR_STT" { + response.ResultCode = 200 + response.Token = request.Token + response.AnounceMents = "서비스에 문제가 발생하여 매장으로 연결해드릴게요." + response.Action = "TRANSFER" + response.Data.BargeIn = "" + response.Data.RecodingFile = "" + response.Data.SttMaxTime = 10 + } else if request.TalkText == "" { + response.ResultCode = 200 + response.Token = request.Token + if s.session[request.Token].NotUnderstand == 3 { + response.AnounceMents = "잘 이해하지 못했습니다. 정확한 상담을 위해 매장으로 연결해드릴게요." + response.Action = "END" + } else { + response.AnounceMents = "잘 이해하지 못했습니다. 다시 말씀해주세요." + response.Action = "STT" + s.session[request.Token] = ResStatus{Count: 1, Status: scnarioConf.Order[0], NotUnderstand: s.session[request.Token].NotUnderstand + 1} + } + response.Data.BargeIn = "" + response.Data.RecodingFile = "" + response.Data.SttMaxTime = 10 + } + // switch eType { // case "sizeup": // response.ResultCode = 200