예외처리 추가

main
JungJun 2 years ago
parent f941e9205a
commit 810fde58aa

@ -26,6 +26,7 @@ type IcsConfig struct {
AgentConfig []AgentConfig `xml:"AGENT"` AgentConfig []AgentConfig `xml:"AGENT"`
SessionExpired SessionExpired `xml:"SESSIONEXPIRED"` SessionExpired SessionExpired `xml:"SESSIONEXPIRED"`
DtmfEndSignal DtmfEndSignal `xml:"DTMFEND"` DtmfEndSignal DtmfEndSignal `xml:"DTMFEND"`
ExceptTest Except `xml:"EXCEPT"` // 예외처리
HomeDir string HomeDir string
ScenarioConfig ScenarioConfig `xml:"SCENARIOORDER"` ScenarioConfig ScenarioConfig `xml:"SCENARIOORDER"`
TimeSleep TimeSleep `xml:"TIMESLEEP"` TimeSleep TimeSleep `xml:"TIMESLEEP"`
@ -154,6 +155,22 @@ type DelConfig struct {
DelHour int `xml:"hour,attr"` DelHour int `xml:"hour,attr"`
} }
type Except struct {
TestInfo TestInfo `xml:"TESTINFO"`
}
type TestInfo struct {
Value bool `xml:"value,attr"`
Type string `xml:"type,attr"`
ResultCode int `xml:"resultCode,attr"`
Token string `xml:"token,attr"`
Action string `xml:"action,attr"`
Announcement string `xml:"announcement,attr"`
Bargein string `xml:"bargein,attr"`
Recodingfile string `xml:"recodingfile,attr"`
Sttmaxtime int `xml:"sttmaxtime,attr"`
}
type RotateConfig struct { type RotateConfig struct {
Size string `xml:"size,attr"` Size string `xml:"size,attr"`
Num string `xml:"num,attr"` Num string `xml:"num,attr"`

@ -173,10 +173,39 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {
fmt.Printf(">>>>>> DATA INFO - method [%s], agent [%s], token [%s]\n", request.Method, agent, request.Token) fmt.Printf(">>>>>> DATA INFO - method [%s], agent [%s], token [%s]\n", request.Method, agent, request.Token)
l.Printf(icslog.LOG_LEVEL_INFO, -1, ">>>>>> DATA INFO - method [%s], agent [%s], token [%s] ", request.Method, agent, request.Token) l.Printf(icslog.LOG_LEVEL_INFO, -1, ">>>>>> DATA INFO - method [%s], agent [%s], token [%s] ", request.Method, agent, request.Token)
response := new(Response)
////////////////////////////////////
///////////// EXCEPT ///////////////
////////////////////////////////////
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
// switch eType {
// case "sizeup":
// response.ResultCode = 200
// response.Token = request.Token + "000000000000000000000000000000"
// response.Action = ""
// response.AnounceMents = ""
// response.Data.BargeIn = ""
// response.Data.RecodingFile = ""
// response.Data.SttMaxTime = 10
// case "sizedown":
// case "space":
// case "null":
// }
}
//////////////////////////////////// ////////////////////////////////////
//////// SCENARIO MAPPING/////////// //////// SCENARIO MAPPING///////////
//////////////////////////////////// ////////////////////////////////////
response := new(Response)
// 현재 들어온 method로 분기 // 현재 들어온 method로 분기
// next 시나리오로 넘겨주기 // next 시나리오로 넘겨주기

Loading…
Cancel
Save