} 위치 변경

wo_translateinfo
jiyoungcheon 2 weeks ago
parent c1db8b0981
commit 144931542c

@ -222,6 +222,7 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
response.Data.RecodingFile = "Y"
s.session[request.Token] = ResStatus{Count: s.session[request.Token].Count, Status: scnarioConf[dnis][s.session[request.Token].Count].Action}
l.Printf(icslog.LOG_LEVEL_INFO, -1, "response.Data: %+v", response.Data)
} else {
switch request.Method {
@ -246,46 +247,45 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
response.Data.RecodingFile = "Y"
s.session[token] = ResStatus{Count: 1, Status: scnarioConf[dnis][1].Action, NotUnderstand: 0, PreEventNum: 1}
}
}
response.Data.UUI = json.RawMessage{}
uuiMap := map[string]interface{}{
"test1": "testdata1231",
"test2": 123,
"test3": 0.1,
}
response.Data.UUI = json.RawMessage{}
uuiMap := map[string]interface{}{
"test1": "testdata1231",
"test2": 123,
"test3": 0.1,
}
// 맵을 JSON으로 마샬링
uuiJSON, err := json.Marshal(uuiMap)
if err != nil {
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "Error marshaling UUI: %v", err)
// 맵을 JSON으로 마샬링
uuiJSON, err := json.Marshal(uuiMap)
if err != nil {
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "Error marshaling UUI: %v", err)
return
}
return
}
// 마샬링된 JSON을 json.RawMessage로 변환
response.Data.UUI = json.RawMessage(uuiJSON)
response.Data.TelNo = request.TelNo
// s.m.Unlock()
// response marshal
// 마샬링된 JSON을 json.RawMessage로 변환
response.Data.UUI = json.RawMessage(uuiJSON)
response.Data.TelNo = request.TelNo
// s.m.Unlock()
// response marshal
resMarshal, jerr := json.Marshal(response)
if jerr != nil {
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "Json Marshal error %v", jerr)
}
l.Printf(icslog.LOG_LEVEL_INFO, -1, "%+v", response)
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Send Message\n %s", string(resMarshal))
resMarshal, jerr := json.Marshal(response)
if jerr != nil {
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "Json Marshal error %v", jerr)
}
l.Printf(icslog.LOG_LEVEL_INFO, -1, "%+v", response)
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Send Message\n %s", string(resMarshal))
// if s.session[request.Token].Count < len(scnarioConf[dnis]) && scnarioConf[dnis][s.session[request.Token].Count].TimeValue {
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Time Sleep %d \r\n", scnarioConf[dnis][s.session[request.Token].Count].TimeSleep)
// time.Sleep(time.Second * time.Duration(time.Duration(scnarioConf[dnis][s.session[request.Token].Count].TimeSleep)))
// } else {
// if s.session[request.Token].Count < len(scnarioConf[dnis]) && scnarioConf[dnis][s.session[request.Token].Count].TimeValue {
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Time Sleep %d \r\n", scnarioConf[dnis][s.session[request.Token].Count].TimeSleep)
// time.Sleep(time.Second * time.Duration(time.Duration(scnarioConf[dnis][s.session[request.Token].Count].TimeSleep)))
// } else {
// }
time.Sleep(time.Second * 1)
// send response
fmt.Fprintln(w, string(resMarshal))
// }
time.Sleep(time.Second * 1)
// send response
fmt.Fprintln(w, string(resMarshal))
}
}
func createToken(callId string) string {

Loading…
Cancel
Save