|
|
@ -179,6 +179,16 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
|
|
|
|
// 현재 들어온 method로 분기
|
|
|
|
// 현재 들어온 method로 분기
|
|
|
|
// next 시나리오로 넘겨주기
|
|
|
|
// next 시나리오로 넘겨주기
|
|
|
|
|
|
|
|
fmt.Printf("response %+v", request)
|
|
|
|
|
|
|
|
if request.Method != "INIT" && request.TalkText == "" {
|
|
|
|
|
|
|
|
response.ResultCode = 200
|
|
|
|
|
|
|
|
response.Token = request.Token
|
|
|
|
|
|
|
|
response.Action = "END"
|
|
|
|
|
|
|
|
response.AnounceMents = "서비스에 장애가 발생하였습니다. 상담사를 연결해드리겠습니다."
|
|
|
|
|
|
|
|
response.Data.BargeIn = "Y"
|
|
|
|
|
|
|
|
response.Data.RecodingFile = "Y"
|
|
|
|
|
|
|
|
response.Data.SttMaxTime = 0
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if request.Method == "HANGUP" {
|
|
|
|
if request.Method == "HANGUP" {
|
|
|
|
s.ByeCheck(request.Method, request.Token)
|
|
|
|
s.ByeCheck(request.Method, request.Token)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -189,9 +199,9 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
response.Token = token
|
|
|
|
response.Token = token
|
|
|
|
response.Action = scnarioConf.Order[1]
|
|
|
|
response.Action = scnarioConf.Order[1]
|
|
|
|
response.AnounceMents = scnarioConf.Value[0]
|
|
|
|
response.AnounceMents = scnarioConf.Value[0]
|
|
|
|
response.Data.BargeIn = "N"
|
|
|
|
response.Data.BargeIn = scnarioConf.BargeIn[0]
|
|
|
|
response.Data.RecodingFile = "Y"
|
|
|
|
response.Data.RecodingFile = "Y"
|
|
|
|
response.Data.SttMaxTime = 4
|
|
|
|
response.Data.SttMaxTime = scnarioConf.SttMaxTime[0]
|
|
|
|
|
|
|
|
|
|
|
|
s.m.Lock()
|
|
|
|
s.m.Lock()
|
|
|
|
s.session[token] = ResStatus{Count: 1, Status: scnarioConf.Order[0]}
|
|
|
|
s.session[token] = ResStatus{Count: 1, Status: scnarioConf.Order[0]}
|
|
|
@ -201,9 +211,9 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
response.Token = request.Token
|
|
|
|
response.Token = request.Token
|
|
|
|
response.Action = scnarioConf.Order[s.session[request.Token].Count+1]
|
|
|
|
response.Action = scnarioConf.Order[s.session[request.Token].Count+1]
|
|
|
|
response.AnounceMents = scnarioConf.Value[s.session[request.Token].Count]
|
|
|
|
response.AnounceMents = scnarioConf.Value[s.session[request.Token].Count]
|
|
|
|
response.Data.BargeIn = "N"
|
|
|
|
response.Data.BargeIn = scnarioConf.BargeIn[s.session[request.Token].Count]
|
|
|
|
response.Data.RecodingFile = "Y"
|
|
|
|
response.Data.RecodingFile = "Y"
|
|
|
|
response.Data.SttMaxTime = 4
|
|
|
|
response.Data.SttMaxTime = scnarioConf.SttMaxTime[s.session[request.Token].Count]
|
|
|
|
|
|
|
|
|
|
|
|
s.m.Lock()
|
|
|
|
s.m.Lock()
|
|
|
|
s.session[request.Token] = ResStatus{Count: s.session[request.Token].Count + 1, Status: scnarioConf.Order[s.session[request.Token].Count+1]}
|
|
|
|
s.session[request.Token] = ResStatus{Count: s.session[request.Token].Count + 1, Status: scnarioConf.Order[s.session[request.Token].Count+1]}
|
|
|
@ -246,6 +256,7 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// response marshal
|
|
|
|
// response marshal
|
|
|
|
resMarshal, jerr := json.Marshal(response)
|
|
|
|
resMarshal, jerr := json.Marshal(response)
|
|
|
|