Subversion Repositories SmartDukaan

Rev

Rev 35660 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35660 Rev 35679
Line 82... Line 82...
82
 
82
 
83
    /**
83
    /**
84
     * Knowlarity Click2Call Webhook - Push Call Log.
84
     * Knowlarity Click2Call Webhook - Push Call Log.
85
     */
85
     */
86
    @RequestMapping(value = "/click2call/push-call-log-handler", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
86
    @RequestMapping(value = "/click2call/push-call-log-handler", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
87
    public ResponseEntity<?> click2callPushLogHandler(HttpServletRequest request, @RequestBody String rawBody) throws Exception {
87
    public ResponseEntity<?> click2calhiPushLogHandler(HttpServletRequest request, @RequestBody String rawBody) throws Exception {
88
        // Log raw JSON body from Knowlarity before processing, so we can see exactly what they sent
88
        // Log raw JSON body from Knowlarity before processing, so we can see exactly what they sent
89
        LOGGER.info("push-call-log raw JSON from Knowlarity: {}", rawBody);
89
        LOGGER.info("push-call-log raw JSON from Knowlarity: {}", rawBody);
-
 
90
 
90
        try {
91
        try {
91
            ObjectMapper objectMapper = new ObjectMapper();
92
            ObjectMapper objectMapper = new ObjectMapper();
92
            PushCallLogModel pushCallLogModel = objectMapper.readValue(rawBody, PushCallLogModel.class);
93
            PushCallLogModel pushCallLogModel = objectMapper.readValue(rawBody, PushCallLogModel.class);
93
            LOGGER.info("update call detail - push log (mapped): {}", pushCallLogModel);
-
 
94
            recordingService.updateAgentCallLog(pushCallLogModel);
94
            recordingService.updateAgentCallLog(pushCallLogModel);
95
        } catch (Exception e) {
95
        } catch (Exception e) {
96
            LOGGER.error("Error processing push-call-log webhook. Raw JSON: {}", rawBody, e);
96
            LOGGER.error("Error processing push-call-log webhook. Raw JSON: {}", rawBody, e);
97
        }
97
        }
98
        return responseSender.ok("true");
98
        return responseSender.ok("true");