# Amazon Chime SDK

{% hint style="info" %}
This feature is currently available to enterprise tiers only.
{% endhint %}

### Before you begin

The Amazon Chime SDK channel requires Amazon Lex as its natural language processing (NLP) engine. Lex interprets what users say and passes structured intents and slot data back to NLX, enabling your conversational AI to understand and respond in real time.

Before setting up your Chime SDK integration, make sure to also complete the Amazon Lex integration in your NLX workspace.&#x20;

<a href="../nlp-engines/amazon-lex" class="button primary">Integrate Amazon Lex</a>

{% hint style="info" %}
Both your Lex and Chime SDK instances must exist in the same AWS region. Check Amazon Connect’s [availability by region](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/) before proceeding.
{% endhint %}

### Integrate Amazon Chime SDK

To integrate the *Amazon Chime SDK* channel, begin by selecting *Resources* from your workspace menu and choosing *Integrations*:

1. Choose *+ Add integration* > Select *Amazon Chime SDK* from the dropdown
2. Provide a name for your Amazon Chime SDK integration&#x20;
3. Click the link to deploy the CloudFormation template > You will be directed to AWS and asked to sign into your account&#x20;
4. The Quick create stack page appears with Template, Stack Name, and Parameters information
5. In the *Capabilities* section at the bottom, select the acknowledgment checkbox > click *Create stack*
6. Once the stack is created and deployed, select the *Outputs tab* and under the Key section find the relevant ARNs/additional fields
7. Enter the following into NLX:
   * *Fulfillment Lambda ARN*: The lambda responsible for the interaction between the NLP (Lex) and the NLU
   * *Management Role ARN*: IAM permissions to create and update contact flows
   * *Bot info table name*: The name of the table that will be deployed in your workspace to store application metadata for call routing purposes
   * *SMA handler Lambda ARN*: The SIP media application Lambda routes calls to your application and escalates depending on the conversation flow

> Optional:
>
> * *Voice connector outbound host name*: Hostname URI for the auto-deployed voice connector which you can route SIP traffic to in order to reach your application from an SIP source. This field does not need to be set for deployment purposes but having it stored in your integration can be helpful so you have all of the information you need to route calls to your applications accessible through NLX

8. Click *Create integration*

### SIP configuration

To further configure the Amazon Chime SDK resources that have automatically deployed, you can visit the Amazon Chime SDK console in AWS.

From there, you can view the SIP Media application, SIP Trunking Voice Connector, and corresponding SIP Rules that have been deployed as part of creating the integration. From this console, you can allow incoming SIP traffic to reach your bots by enabling Termination on the Voice Connector and configuring the Allowed hosts list to include any IP addresses you would like to whitelist.

<div align="left"><figure><img src="https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2Ftaydk8WD3e6Y3ZPHTdri%2FingressVC.png?alt=media&#x26;token=81aab1ff-bf0e-4894-9a7b-c840c27bb6d0" alt=""><figcaption><p>Allowed hosts list in Chime SDK Console</p></figcaption></figure></div>

You can also use this console to associate a phone number with your SIP media application through the following steps:&#x20;

1. Navigate to *Phone number management* > Click the *Orders* tab

<figure><img src="https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2FVBwJGnuSHCKBKCZ2A0i2%2Fimage.png?alt=media&#x26;token=6f2b7336-de2a-4aad-a392-25097ac6ba1a" alt=""><figcaption></figcaption></figure>

2. Click *Provision phone numbers* > Select *SIP Media Application Dial-In*
3. Select Country, Type, and Area Code from each dropdown > Click the *Provision* button

<div align="left"><figure><img src="https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2FkicsRDDtcOOm4FgM0JjQ%2Fprovision2.png?alt=media&#x26;token=0707072c-255c-4ed3-ab39-bed30b6fd44a" alt=""><figcaption></figcaption></figure></div>

Now that we have a phone number, the next step is to create a new SIP Rule to associate it with your SIP Media Application:

4. Navigate to *SIP Rules* > Click *Create SIP Rule*&#x20;
5. Name your rule, set the Trigger type as *To phone number*, and set the Phone number to the one you just provisioned
6. After selecting *Next*, set the SIP media application to the one that was created for you. There is a field for priority, which can be left as the default value unless you have a special use case. Once these two fields are set, click *Create SIP rule*

After completing those steps your bots can now receive PSTN traffic on the number you provisioned. To associate this phone number with a specific bot you would just need to set that value in the Phone number by language section of the corresponding application’s Channel (more information on that can be found in the documentation section for the Amazon Chime SDK Channel).

### Next steps

To successfully use your Amazon Chime SDK integration with applications created in your workspace, be sure to complete the following:

1. Create or select an existing [Core application](https://docs.nlx.ai/platform/nlx-platform-guide/ai-applications/types/core) in your NLX workspace
2. From your app's *Configuration* tab, add your Amazon Chime SDK channel under the Delivery section
3. Create an application [build and deploy](https://docs.nlx.ai/platform/nlx-platform-guide/ai-applications/types/core#deployment)
