|
|
|
@ -311,23 +311,23 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
// fmt.Println(scnarioConf[dnis])
|
|
|
|
|
switch request.Method {
|
|
|
|
|
case "INIT":
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "INIT..s.session[request.Token].Count: %d", s.session[request.Token].Count)
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "INIT..scnarioConf[dnis][1].AnounceMents: %s", scnarioConf[dnis][1].AnounceMents)
|
|
|
|
|
token := createToken(request.CallId)
|
|
|
|
|
response.ResultCode = 200
|
|
|
|
|
response.Token = token
|
|
|
|
|
response.Action = scnarioConf[dnis][s.session[request.Token].Count+1].Action
|
|
|
|
|
response.AnounceMents = scnarioConf[dnis][s.session[request.Token].Count+1].AnounceMents
|
|
|
|
|
response.Data.Speed = scnarioConf[dnis][s.session[request.Token].Count+1].Speed
|
|
|
|
|
response.Data.VoiceName = scnarioConf[dnis][s.session[request.Token].Count+1].VoiceName
|
|
|
|
|
response.Data.Volume = scnarioConf[dnis][s.session[request.Token].Count+1].Volume
|
|
|
|
|
response.Data.Pitch = scnarioConf[dnis][s.session[request.Token].Count+1].Pitch
|
|
|
|
|
response.Data.MaxWaitTime = scnarioConf[dnis][s.session[request.Token].Count+1].MaxWaitTime
|
|
|
|
|
response.Data.BargeIn = scnarioConf[dnis][s.session[request.Token].Count+1].BargeIn
|
|
|
|
|
response.Data.SttMaxTime = scnarioConf[dnis][s.session[request.Token].Count+1].SttMaxTime
|
|
|
|
|
response.Data.MaxDigit = scnarioConf[dnis][s.session[request.Token].Count+1].MaxDigit
|
|
|
|
|
response.Data.EndCharacter = []string{scnarioConf[dnis][s.session[request.Token].Count+1].EndCharacter}
|
|
|
|
|
response.Data.DigitTerm = scnarioConf[dnis][s.session[request.Token].Count+1].DigitTerm
|
|
|
|
|
response.AnnounceFilePath = scnarioConf[dnis][s.session[request.Token].Count+1].AudioFilePath
|
|
|
|
|
response.Action = scnarioConf[dnis][1].Action
|
|
|
|
|
response.AnounceMents = scnarioConf[dnis][1].AnounceMents
|
|
|
|
|
response.Data.Speed = scnarioConf[dnis][1].Speed
|
|
|
|
|
response.Data.VoiceName = scnarioConf[dnis][1].VoiceName
|
|
|
|
|
response.Data.Volume = scnarioConf[dnis][1].Volume
|
|
|
|
|
response.Data.Pitch = scnarioConf[dnis][1].Pitch
|
|
|
|
|
response.Data.MaxWaitTime = scnarioConf[dnis][1].MaxWaitTime
|
|
|
|
|
response.Data.BargeIn = scnarioConf[dnis][1].BargeIn
|
|
|
|
|
response.Data.SttMaxTime = scnarioConf[dnis][1].SttMaxTime
|
|
|
|
|
response.Data.MaxDigit = scnarioConf[dnis][1].MaxDigit
|
|
|
|
|
response.Data.EndCharacter = []string{scnarioConf[dnis][1].EndCharacter}
|
|
|
|
|
response.Data.DigitTerm = scnarioConf[dnis][1].DigitTerm
|
|
|
|
|
response.AnnounceFilePath = scnarioConf[dnis][1].AudioFilePath
|
|
|
|
|
response.Data.RecodingFile = "Y"
|
|
|
|
|
//s.m.Lock()
|
|
|
|
|
s.session[token] = ResStatus{Count: 1, Status: scnarioConf[dnis][0].Action, NotUnderstand: 0, PreEventNum: 1}
|
|
|
|
|