AWS Connect dynamic attributes has an extra dot . added

0

Hi, I'm using the start_outbound_voice_contact in lambda to start a contact flow. The lambda is passing an attribute of S3 path/ folder name where a voice recording is stored. I want to use this path to play the recording in a Get Customer Input block.

This is what I have configured in the Set Contact Attributes block: User defined : Namespace Value: FileName Set dynamically Namespace: External Value: $.Attributes.FileName

If I change the attribute to "$.External.FileName", it doesn't work.

When I look at the Cloudwatch logs, I see the parameter as below "Parameters": { "Value": "..Provide+options+if+no+agent+is+available.wav", "Key": "FileName" }

Below is what I have configured in the Get Customer Input block: Specify an audio file from an S3 bucket Set manually S3 file path: https://<s3 bucket>.s3.amazonaws.com/prompts-audiofiles/$['Attributes']['FileName']

In the Cloudwatch logs, the S3 path has a . included before the file name and hence the prompt is failing:

"Parameters": { "PromptLocation": "https://<s3 bucket>.s3.amazonaws.com/prompts-audiofiles/.Provide+options+if+no+agent+is+available.wav", "Timeout": "5000", "PromptSource": "S3", "MaxDigits": "1" }

Can anyone help identify and fix this issue of an extra dot . added for the parameter?

Thanks

asked a year ago479 views
2 Answers
0

Hi When you call start_outbound_voice_contact, Are you passing your attributes to Attributes param?

    Attributes={
        's3url': 'http://mybucket/mypath/filename.wav'
    },

Later in the contact flow you can reference this value using $.Attributes.s3url . No need to setContactAttribute inside the Contact Flow

The second part, I recommend to include the full path in the Attribute and then using Set Dynamically -> User Defined -> $.S3url (or $.Attributes.s3url) in GetCustomerInput block Example:

Notes:

  • It has to be dynamically because with this connect will render de value of $.s3url
  • also the way to access nested values is using "." (like $.Attributes.filename)
AWS
Kike
answered a year ago
profile pictureAWS
EXPERT
reviewed a year ago
  • Hi Kike,

    Thanks for your response. I have provided the attributes in the Lambda Attributes={ 'S3Path': 'https://<bucket-name>.s3.amazonaws.com/prompts-audiofiles/Provide+options+if+no+agent+is+available.wav' }

    I removed the Set Contact Attributes and added the below in Get Customer Input block:

    Specify an audio file from an S3 bucket Set dynamically User defined : $.S3Path

    But logs show the below: "Parameters": { "PromptLocation": ".", }

    If I provide the value as $.Attributes.S3Path, then I get the below - URL with a dot . added at the beginning of the URL:

    "Parameters": { "PromptLocation": ".https://<bucket name>.s3.amazonaws.com/prompts-audiofiles/Provide+options+if+no+agent+is+available.wav", }

  • Since your S3Path attribute is in the 'User defined' namespace ($.Attributes) you should be able to just reference it by the attribute name. Namespace = User defined Value = S3Path

    https://docs.aws.amazon.com/connect/latest/adminguide/how-to-reference-attributes.html

0

Oh! Since the S3Path attribute is coming from the lambda function, I was using the Namespace as External. Based on Kike's response, it also worked when I used User Defined.

So now with the value as "S3Path" it finally worked.

Thank you so much for your help @Kike and @lukwarne!

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions