// welcomeMessagePromptFlag private String validateCallDetailsMobileKunjiElements( CallDetailRecordRequest callDetailRecordRequest) { StringBuilder failureReasons = new StringBuilder(); if (null == callDetailRecordRequest.getWelcomeMessagePromptFlag()) { failureReasons.append(String.format(NOT_PRESENT, "welcomeMessagePromptFlag")); } return failureReasons.toString(); }
private void createCallDetailRecord( FrontLineWorker flw, CallDetailRecordRequest callDetailRecordRequest, Service service) { CallDetailRecord cdr = new CallDetailRecord(); cdr.setFrontLineWorker(flw); cdr.setCallingNumber(callDetailRecordRequest.getCallingNumber()); cdr.setCallId(callDetailRecordRequest.getCallId()); cdr.setOperator(callDetailRecordRequest.getOperator()); cdr.setCircle(callDetailRecordRequest.getCircle()); cdr.setCallStartTime( new DateTime(callDetailRecordRequest.getCallStartTime() * MILLISECONDS_PER_SECOND)); cdr.setCallEndTime( new DateTime(callDetailRecordRequest.getCallEndTime() * MILLISECONDS_PER_SECOND)); cdr.setCallDurationInPulses(callDetailRecordRequest.getCallDurationInPulses()); cdr.setEndOfUsagePromptCounter(callDetailRecordRequest.getEndOfUsagePromptCounter()); cdr.setCallStatus(callDetailRecordRequest.getCallStatus()); cdr.setCallDisconnectReason(callDetailRecordRequest.getCallDisconnectReason()); if (service == Service.MOBILE_KUNJI) { cdr.setWelcomePrompt(callDetailRecordRequest.getWelcomeMessagePromptFlag()); } callDetailRecordService.add(cdr); for (CallContentRequest callContentRequest : callDetailRecordRequest.getContent()) { CallContent content = new CallContent(); content.setContentName(callContentRequest.getContentName()); content.setContentFile(callContentRequest.getContentFileName()); content.setStartTime( new DateTime(callContentRequest.getStartTime() * MILLISECONDS_PER_SECOND)); content.setEndTime(new DateTime(callContentRequest.getEndTime() * MILLISECONDS_PER_SECOND)); if (service == Service.MOBILE_KUNJI) { content.setMobileKunjiCardCode(callContentRequest.getMkCardCode()); } if (service == Service.MOBILE_ACADEMY) { content.setType(callContentRequest.getType()); content.setCompletionFlag(callContentRequest.getCompletionFlag()); } content.setCallDetailRecord(cdr); callContentService.add(content); } }