Amazon Chime SDK¶
Introduction¶
Amazon Chime SDK is the underlying platform provided by Amazon Web Services (AWS) that enables businesses to make and receive phone calls over the internet with the help of Amazon Chime Voice Connector.
With Amazon Chime Voice Connector and DIDWW SIP Trunks, businesses can use their own telephone numbers to make and receive phone calls. This allows businesses to maintain a consistent communication experience with their customers.
Amazon Chime Voice Connector is designed to be simple to set up and manage, and can be integrated with other AWS services, for example such as Amazon S3 and Amazon Lambda, for more advanced use cases.
This configuration guide describes how to setup Amazon Chime Voice Connector using SIP Media Application with basic Amazon Lambda sample code to interwork with DIDWW Voice IN SIP trunk services (Fig 1).

Fig. 1. Basic flow diagram.¶
Getting started¶
What you need to get started:
Creating Amazon Chime Voice Connector¶
Step 1.
Select Voice connector in the Chime menu.
Click Create new voice connector button. (Fig 2).

Fig. 2. Creating a new voice connector.¶
Step 2.
Enter Voice connector name.
Choose AWS region.
For Encryption (TLS) select Enabled or Disabled for UDP (Fig 3).

Fig. 3. Voice connector configuration.¶
Step 3.
In the Voice connector select tab Termination.
Set Termination status to Enabled.
Copy/note Outbound host name. (Fig 4). (Outbound host name will be used later when configuring DIDWW SIP inbound trunk.)

Fig. 4. Termination tab configuration.¶
Step 4.
Add DIDWW inbound signalling IP addresses to the Amazon Chime voice connector Allowed hosts list tab, as shown in the example below (Fig 5).
46.19.209.14 (for New York POP)
46.19.210.14 (for Frankfurt POP)
46.19.212.14 (for Los Angeles POP)
46.19.213.14 (for Miami POP)
46.19.214.14 (for Singapore POP)
46.19.215.14 (for Hong Kong POP)
185.238.173.14 (for Amsterdam POP)

Fig. 5. Adding DIDWW inbound signalling IPs.¶
Creating Amazon Lambda function¶
Step 1.
In the AWS Lambda menu choose Functions.
Click Create function. (Fig 6).

Fig. 6. Creating AWS Lambda function.¶
Step 2.
Choose a sample code from available blueprints.
In the search field type hello world , select the sample of hello-world for nodejs.
Click Configure (Fig 7).

Fig. 7. Configuring AWS Lambda function.¶
Step 3.
Enter a function name of your choice.
Select Create a new role with basic Lambda permissions as the Execution role.
Click Create Function at the bottom of the page. (Fig 8).

Fig. 8. Configuring AWS Lambda function.¶
Step 4.
The following window allows you to write, deploy, and test your Lambda code.
Copy/note Function ARN name (Fig 9). (It will be used in the next step.)
A basic example of Lambda nodejs code that passes Source and Destination Number to an external URL.
const https = require('http');
exports.handler = async (event) => {
let dataString = '';
var source='';
source=event.CallDetails.Participants[0].From;
var destination='';
destination=event.CallDetails.Participants[0].To;
const response = await new Promise((resolve, reject) => {
const req = https.get(`http://example.com/?source=${source}&destination=${destination}`, function(res) {
res.on('data', chunk => {
dataString += chunk;
});
res.on('end', () => {
resolve({
statusCode: 200,
body: (dataString),
});
});
});
req.on('error', (e) => {
reject({
statusCode: 500,
body: 'Something went wrong!'
});
});
});
return response;
};

Fig. 9. Function overview.¶
Creating Amazon Chime SIP Media Application¶
Step 1.
Choose SIP media applications in your Chime menu.
Click Create (Fig 10).

Fig. 10. Creating SIP media application.¶
Step 2.
Enter a SIP media application name of your choice
Choose the same AWS region as chosen during Voice connector creation of this guide (Fig 3).
Paste the previously copied Lambda Function ARN name (Fig 9).
Click Create (Fig 11).

Fig. 11. Filling in the required data.¶
Creating Amazon Chime SIP rule¶
Step 1.
Choose SIP rules in your Chime menu.
Click Create (Fig 12).

Fig. 12. Creating SIP rule.¶
Step 2.
Enter a rule name of your choice
In the Trigger type dropdown menu select Request URI hostname.
In the Request URI hostname select the previously created Amazon Chime Voice Connector hostname (Fig 4).
Click Next (Fig 13).

Fig. 13. Selecting fields.¶
Step 3.
Select the previously created SIP media application.
Click Create (Fig 14).

Fig. 14. Selecting SIP media application.¶
Creating DIDWW SIP trunk¶
Step 1.
Log in to the DIDWW self-service portal ( https://my.didww.com/users/sign_in ).
On the left-hand menu select Trunks.
In the Voice IN tab click Create new.
Select SIP Trunk from the dropdown list (Fig 15).

Fig. 15. Creating a new SIP trunk.¶
Step 2.
Add a name of your choice for your trunk.
Add “+{DID}“ (no commas) in the Username section.
Select e164 as CLI Format.
Enter “+” (no commas) in the CLI Prefix section.
Protocol UDP (TLS is available as well if encryption is preffered).
Port 5060 for UDP (5061 for TLS).
Add your Amazon SIP connector host name in the Host field from the previous step of this guide. (Fig 4).
Click Create (Fig 16).

Fig. 16. Editing SIP trunk.¶
Assigning SIP trunk to your number at DIDWW¶
Step 1.
In your DIDWW account select DID Numbers.
Click on “Voice” in the “Trunk” column (Fig 17).

Fig. 17. Editing DID number voice trunk.¶
Step 2.
Select the previously created voice trunk.
Click Submit (Fig 18).

Fig. 18. Assigning voice trunk.¶
Support and Additional Resources¶
For additional information, please review Amazon Chime SDK documentation.
For more information or additional troubleshooting please contact DIDWW Technical Support Team at support@didww.com.