Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Contact Lens to Salesforce (5.23.3) #211

Open
Marian-Lemaitre opened this issue Jul 26, 2024 · 1 comment
Open

Export Contact Lens to Salesforce (5.23.3) #211

Marian-Lemaitre opened this issue Jul 26, 2024 · 1 comment

Comments

@Marian-Lemaitre
Copy link

Hello Team!

I installed the package in version 5.23.3 (new package and not an update) and I notice that the contact lens are not imported.

Contact Channel

I have correctly defined:

  1. The trigger :
Trigger
  1. These attributes on my Flow :
Attribute name value
postcallRedactedRecordingImportEnabled true
postcallTranscribeEnabled true
postcallTranscribeLanguage fr-FR
postcallTranscribeComprehendAnalysis snt,dl,kw,syn
ContactLensImportEnabled true
  1. The PostcallRecordingImportEnabled parameter on the lambda package is correctly set to "true"
Cloudformation

When I check the logs of the lambda function (sfProcessContactLens) I have 2 Issues :

LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html

Response { "errorMessage": "'Contents'", "errorType": "KeyError", "requestId": "b6e2418d-072c-406e-9fe0-6859fb9d622f", "stackTrace": [ " File \"/var/task/sfProcessContactLens.py\", line 98, in lambda_handler\n raise e\n", " File \"/var/task/sfProcessContactLens.py\", line 87, in lambda_handler\n contactLensConversationCharacteristics = processContactLensConversationCharacteristics(contactLensObj, bucket, contactLensTranscripts)\n", " File \"/var/task/sfContactLensUtil.py\", line 112, in processContactLensConversationCharacteristics\n redactedRecordingLocation = getRedactedRecordingLocation(contactId, connectBucket)\n", " File \"/var/task/sfContactLensUtil.py\", line 142, in getRedactedRecordingLocation\n for obj in page['Contents']:\n" ] }

Did I miss something in my setup ?

Because I already implemented this feature in another Salesforce environment with an old package and it works perfectly.

Thanks in advance for your help!

@Marian-Lemaitre
Copy link
Author

Hello,

I found a temporary solution.

I added a new condition on the Lambda function sfProcessContactLens,

On the "getRedactedRecordingLocation" function in the sfContactLensUtil.py file I set this condition :

if 'Contents' in page:

The code part is now like this:


def getRedactedRecordingLocation(contactId, connectBucket):
    logger.info('Retrieving Redacted Recording S3 Location, contact ID is: %s', contactId)
    redactedRecordingKey = contactId + '_call_recording_redacted_'


    # Using paginator because S3 only returns up to 1000 objects from list_objects_v2() method
    client = boto3.client('s3')
    paginator = client.get_paginator('list_objects_v2')
    pages = paginator.paginate(Bucket=connectBucket, Prefix='Analysis/Voice/Redacted')
    
    
    for page in pages:
      # I change here below ! : I added the condition if 'Contents' in page:
      if 'Contents' in page:
        for obj in page['Contents']:
            if redactedRecordingKey in obj['Key'] and obj['Key'].endswith('.wav'):
                redactedRecordingLocation = connectBucket + '/' + obj['Key']
                return redactedRecordingLocation
    logger.warn('Redacted Recording Not Found!')
    return ''

I see it works, but I have a problem when I click on AC Channel Analytics
image
image

it may not be the best but i only found this for now
Sorry if my explanations are not clear, this is my first time using Github !

Thanks !

@Marian-Lemaitre Marian-Lemaitre closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant