|
|
|
@ -107,6 +107,7 @@ type ScenarioSession struct {
|
|
|
|
|
var handles []*handleInfo
|
|
|
|
|
var session []*ScenarioSession
|
|
|
|
|
var tokenMap map[string]string
|
|
|
|
|
var customerTelno string
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
handles = make([]*handleInfo, HANDLE_NUM)
|
|
|
|
@ -262,15 +263,30 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
// fmt.Printf("lv 2 =>%#v\n", response)
|
|
|
|
|
// fmt.Println("-------------------------")
|
|
|
|
|
|
|
|
|
|
if customerTelno == "" {
|
|
|
|
|
customerTelno = request.TelNo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if translateinfo.Use {
|
|
|
|
|
srcSession := s.GetSession(request.Token)
|
|
|
|
|
dstSession := s.GetSession(translateinfo.Token)
|
|
|
|
|
if request.TalkText != "" {
|
|
|
|
|
if customerTelno == request.TelNo {
|
|
|
|
|
l.PrintAnnouce(request.TalkText, true)
|
|
|
|
|
} else {
|
|
|
|
|
l.PrintAnnouce(request.TalkText, false)
|
|
|
|
|
}
|
|
|
|
|
dstRlt := ResStatus{Count: dstSession.Count + 1, TransLateText: request.TalkText}
|
|
|
|
|
s.UpdateSession(translateinfo.Token, dstRlt)
|
|
|
|
|
response.AnounceMents = request.TalkText
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if srcSession.TransLateText != "" {
|
|
|
|
|
if customerTelno == request.TelNo {
|
|
|
|
|
l.PrintAnnouce(srcSession.TransLateText, false)
|
|
|
|
|
} else {
|
|
|
|
|
l.PrintAnnouce(srcSession.TransLateText, false)
|
|
|
|
|
}
|
|
|
|
|
response.AnounceMents = srcSession.TransLateText
|
|
|
|
|
srcRlt := ResStatus{Count: srcSession.Count + 1, Status: scenario.Action, TransLateText: scenario.AnounceMents}
|
|
|
|
|
s.UpdateSession(request.Token, srcRlt)
|
|
|
|
|