in source/aws-connect-vm-serverless/src/main/java/com/amazonaws/kvstream/ContactVoicemailRepo.java [43:79]
public void createRecord(
Long timestamp, String agentId, Boolean shouldTranscribe,
@Nullable String transcribeStatus, Boolean shouldEncrypt, S3UploadInfo uploadInfo
) {
Item item = new Item()
.withKeyComponent("contactId", contactId)
.withLong("timestamp", timestamp)
.withString("contactPhoneNumber", contactPhoneNumber)
.withString("assigneeId", agentId)
.withKeyComponent("readerId", agentId)
.withBoolean("shouldTranscribe", shouldTranscribe)
.withBoolean("shouldEncrypt", shouldEncrypt)
.withString("recordingUrl", uploadInfo.getResourceUrl())
.withString("recordingBucketName", uploadInfo.getBucketName())
.withString("recordingObjectKey", uploadInfo.getObjectKey())
.withString("recordingBucketRegion", uploadInfo.getRegion().getName());
if (transcribeStatus != null) {
item.withString("transcribeStatus", transcribeStatus);
}
try {
if (item != null) {
getDdbClient().getTable(CONTACT_VOICEMAIL_TABLE_NAME).putItem(item);
}
} catch (Exception e) {
logger.error("Exception while writing to DDB: ", e);
}
if (logRecordsFlag) {
logger.info(String.format("Record: %s %d %b %b",
contactId,
timestamp,
shouldTranscribe,
shouldEncrypt));
}
}