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