Meetrix Coturn - Developer Guide

Meetrix Coturn - Developer Guide

Welcome to the Meetrix Coturn Developer Guide! This guide is designed to assist you in seamlessly integrating Coturn into your AWS environment. Whether you're new to AWS or an experienced developer, you'll discover step-by-step instructions, configuration details, and troubleshooting tips to ensure a smooth experience.

Brief Overview of Meetrix Coturn

Meetrix Coturn is a robust solution designed to address NAT traversal challenges in real-time communication applications. Leveraging the capabilities of Coturn, Meetrix Coturn offers a seamless experience for applications such as VoIP (Voice over Internet Protocol), online gaming, and peer-to-peer (P2P) communication within the AWS ecosystem.

Video
Blog
Switch to Hassle-Free Set up of CoTurn: Explore One-Click Deployment at 75% Low Pricing
Transition to CoTurn with one-click deployment at 75% lower pricing, streamlined for organizations in the UK, USA, Europe, Ireland, Singapore, and Thailand. Simplify your setup process and achieve cost-effective solutions effortlessly.”

Prerequisites

Before you get started with the Coturn AMI, ensure you have the following prerequisites:

  • Basic knowledge of AWS services, including EC2 instances and CloudFormation.
  • An active AWS account with appropriate permissions.

Launching the AMI

Step 1: Find and Select 'Coturn' AMI

  1. Log in to your AWS Management Console.
  2. Navigate to the "Meetrix Coturn" in  AWS Marketplace.

Step 2:  Initial Setup & Configuration

  1. Click the "Continue to Subscribe" button.
  2. After subscribing, you will need to accept the terms and conditions. Click on "Accept Terms" to proceed.
  3. Please wait for a few minutes while the processing takes place. Once it's completed, click on "Continue to Configuration".
  4. Select your preferred region in "Configure this software" page and click "Continue to Launch" button.
  5. From the "Choose Action" dropdown menu in "Launch this software" page, select "Launch CloudFormation" and click "Launch" button.

Create CloudFormation Stack

Step1: Create stack

  1. Ensure the "Template is ready" radio button is selected under "Prepare template".

2. Click "Next".

Step2: Specify stack options

  1. Provide a unique "Stack name".
  2. Provide the "Admin Email" for SSL generation.
  3. Choose an instance type, "CoturnInstanceType" (Recommended: t3.micro).
  4. For "DeploymentName", enter a name of your choice.
  5. Select your preferred "keyName".
  6. Set "SSHLocation" as "0.0.0.0/0".
  7. Keep "SubnetCidrBlock" as "10.0.0.0/24".
  8. Provide a public domain name for "TurnDomainName". (Coturn will automatically try to setup SSL based on provided domain name, if that domain hosted on Route53. Please make sure your turn domain name hosted on route53. If its unsuccessful then you have to setup SSL manually)
  9. Enter a descriptive string to "TurnRealm" (e.g. turn.example.com, meetrixCoturn123).
  10. Enter a strong password for "TurnStaticAuthSecret".
  11. Keep "VpcCidrBlock" as "10.0.0.0/16".
  12. Click "Next".

Step3: Configure stack options

  1. Under "Stack failure options", select "Roll back all stack resources".
  2. click "Next".

Step4: Review

  1. Review and verify the details you've entered.

2. Tick the box that says, "I acknowledge that AWS CloudFormation might create IAM resources with custom names".

3. Click "Submit".

Afterward, you'll be directed to the CloudFormation stacks page.

You can easily locate the corresponding stack by searching for the stack name you entered in Step 2.

Please wait for 5-10 minutes until the stack has been successfully created. Afterward, you can click the "Refresh" button under the "Stacks" section.

Generate SSL Manually

Coturn will automatically try to setup SSL based on provided domain name, if that domain hosted on Route53. If its unsuccessful then you have to setup SSL manually.

Step1: Copy IP Address

Copy the Public IP address indicated as "PublicIp" in the "Outputs" tab.

Step2: Log in to the server

  1. Open the terminal and go to the directory where your private key is located.
  2. Paste the following command into your terminal and press Enter: ssh -i <your key name> ubuntu@<Public IP address>.

3. Type "yes" and press Enter. This will log you into the server.

Step3: Generate SSL

Method1:

1. Paste the following command into your terminal and press Enter:

sudo /root/certificate_generate_dns.sh

Method2:

  1. Copy the "PublicIp" as previously explained in "Step1: Copy IP Address" within the "Set SSL Manually" section.
  2. Go to AWS "Route 53" and navigate to "Hosted Zones".
  3. From there, select the domain you provided to "TurnDomainName".

4. Click "Edit record" in the "Record details" and then paste the copied "PublicIp" into the "value" textbox and click "Save".

5. Paste the following command into your terminal and press Enter:

sudo /root/certificate_generate_standalone.sh

Admin Email is acquiring for generate SSL certificates.

Testing Coturn on Server

Test for UDP:

  1. Follow "step1" and "step2" in the "Generate SSL Manually" section to log in to the server.
  2. Copy the script provided below into the terminal and press Enter to generate a username and a password. Ensure that you replace "myscret" with the "TurnStaticAuthSecret" you provided in "Step2" under the "Create CloudFormation Stack" section.
secret=mysecret && \
time=$(date +%s) && \
expiry=8400 && \
username=$(( $time + $expiry )) &&\
echo username:$username && \
echo password : $(echo -n $username | openssl dgst -binary -sha1 -hmac $secret | openssl base64)

Output of this script would be some thing like following.

username:1525325424
password : YuzkH/Th9BBaRj4ivR03PiCfr+E=

3. For testing we can use Trickle-Ice testing tool. Go to trickle-ice page and enter following details.

STUN or TURN URI : turn:<PublicIp>:3478
TURN username: <Generated_username>
TURN password: <Generated_password>

Then click Add Server and then Gather candidates button. If you have done everything correctly, you should see Done as the final result.

If you do not get any response or if you see any error messages, please double check if you have followed this guide as it is.

Test for TCP:

  1. Follow the instructions in the "Generate SSL Manually" section to set up SSL manually if it is not configured automatically.
  2. Go to trickle-ice page and enter following details.
STUN or TURN URI : turns:<YOUR_DOMAIN>:443
TURN username: <Generated_username>
TURN password: <Generated_password>

Then click Add Server and then Gather candidates button. If you have done everything correctly, you should see Done as the final result.

If you do not get any response or if you see any error messages, please double check if you have followed this guide as it is.

Shutting Down Coturn

  1. Click the link labeled "Coturn" in the "Resources" tab to access the EC2 instance, you will be directed to the coturn instance in EC2.

2. Select the coturn instance by marking the checkbox and click "Stop instance" from the "Instance state" dropdown. You can restart the instance at your convenience by selecting "Start instance".

Remove Coturn

Delete the stack that has been created in the AWS Management Console under 'CloudFormation Stacks' by clicking the 'Delete' button.

Technical Support

Reach out to Meetrix Support (support@meetrix.io)  for assistance with Meetrix Coturn issues.

Discover Seamless Meetings with >>>
Meetrix