From 2ff652d860b30f7f1dac58e0f0e15d92114a7d7d Mon Sep 17 00:00:00 2001 From: jiyoungcheon Date: Sun, 5 Jan 2025 19:33:39 -0500 Subject: [PATCH] timecheck added --- icshttp/handler.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/icshttp/handler.go b/icshttp/handler.go index 20241c4..88a7545 100644 --- a/icshttp/handler.go +++ b/icshttp/handler.go @@ -218,7 +218,7 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) { } agent := strings.SplitN(request.CallId, "@", 2) - l.Printf(icslog.LOG_LEVEL_INFO, -1, ">>>>>> DATA INFO - method [%s], agent [%s], token [%s] talk[%s]", request.Method, agent, request.Token, request.TalkText) + l.Printf(icslog.LOG_LEVEL_INFO, -1, ">>>>>> DATA INFO[%d] - method [%s], agent [%s], token [%s] talk[%s]", time.Now().UnixMilli(), request.Method, agent, request.Token, request.TalkText) response := new(Response) dnis := request.Dnis @@ -271,10 +271,11 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) { srcSession := s.GetSession(request.Token) dstSession := s.GetSession(translateinfo.Token) if request.TalkText != "" { + l.Printf(icslog.LOG_LEVEL_DEBUG, -1, "[timecheck] Received text [%s] at [%d]", request.TalkText, time.Now().UnixNano()) if customerTelno == request.TelNo { - l.PrintAnnouce(request.TalkText, false) - } else { 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) @@ -345,6 +346,10 @@ func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, string(resMarshal)) + if response.AnounceMents != "" { + l.Printf(icslog.LOG_LEVEL_DEBUG, -1, "[timecheck] Sent the text [%s] at [%d]", response.AnounceMents, time.Now().UnixNano()) + } + } // func (s *ScenarioSession) BOTPFunc(w http.ResponseWriter, r *http.Request) {