Integrating Amazon Chime SDK with UniFi Talk on UDM Pro

Introduction

Hey there! Welcome to my little corner of the internet where I geek out over making our digital conversations smoother and more reliable. Today, I'm diving into how I mixed a bit of cloud magic from Amazon with the solid foundation of UniFi gear to upgrade my communication setup. If you've ever wondered how to get Amazon Chime SDK and UniFi Talk to play nicely on a UDM Pro, you're in the right place. Whether you're sprucing up your home office, aiming to give your business's comms a boost, or just love tinkering with the latest tech toys, stick around. I'll walk you through my journey of connecting the dots for a seamless integration. Spoiler: It's pretty cool!

Background

Amazon Chime SDK

Imagine being able to sprinkle some real-time communication fairy dust on your apps, adding video, chat, and all that good stuff with a snap of your fingers. That's pretty much what Amazon Chime SDK lets you do. It's this awesome set of tools from the cloud geniuses over at AWS that helps developers add all sorts of communication features to their apps without losing sleep over the nitty-gritty backend stuff. It's all about making your apps talk and listen, without the headache.

UniFi Talk

Then there's UniFi Talk, which is like the cool kid on the block in the world of VoIP. Part of the whole UniFi universe, it lets you handle calls like a boss—think call routing, voicemail, and the works, all while playing nice with other UniFi gadgets. It's for anyone who wants their communication system to be as sleek and integrated as their network.

UDM Pro

And let's not forget about the UniFi Dream Machine Pro (UDM Pro). This bad boy is the Swiss Army knife of the network world, packing a punch with its combo of security gateway, switch, and network controller all rolled into one. It's the brain behind the UniFi setup, making sure everything from your internet speed to your security settings is running smoothly. When it comes to setting up a top-notch communication system, think of the UDM Pro as mission control.

Mixing Amazon Chime SDK with UniFi Talk on a UDM Pro is like throwing a tech party where everyone's invited and gets along. It's about leveraging the cloud's flexibility with the reliability of UniFi gear for a communication setup that's not just powerful but also kind of fun to put together. Ready to dive in? Let's get started on this tech adventure together.

Prerequisites

  • Amazon Chime SDK access with the ability to provision a Voice Connector

    • I did find that AWS' fraud detector prevented me from provisioning a Voice Connector initially, I ended up going back and forth with Support and over time I was able to provision a Voice Connector and phone numbers.

  • UDM Pro or other UniFi Talk controller device

    • I am running UniFi OS 3.2.12 / Talk 2.3.3

  • UniFi Talk compatible phone

    • I am using a Touch Max

Integration Process

Buckle up, tech enthusiasts! It’s time to venture into the core of our integration quest. This journey unfolds in two pivotal stages, starting with the magic in the clouds before bringing it all back down to our own digital domain. Our first order of business is to harness the power of the Amazon Chime SDK—this is where we lay the groundwork for our sophisticated communication features, enabling everything from crystal-clear video calls to real-time messaging and screen sharing capabilities.

Configuring the Amazon Chime SDK is like casting the first spell in our tech wizardry book. We'll navigate the Amazon Chime SDK console, setting up the necessary components to bring our application to life with top-notch communication abilities. This part is crucial, as it sets the stage for the seamless integration and interoperability with our UniFi setup.

Once we've got the cloud part of the equation sorted, we'll circle back to terra firma, where the UniFi Talk Application awaits our expert touch. Here, we’ll integrate the groundwork laid by the Amazon Chime SDK into our local setup, ensuring that our on-premises communication hub is in perfect harmony with the cloud-based wonders we've conjured up.

Amazon Chime SDK Configuration

  • Provision the Voice Connector

    • Step 1: In the AWS Console, go to the Amazon Chime SDK landing page in the Region you want to deploy to.

    • Step 2: Click the Create Voice Connector button.

    • Step 3: Configuration of the Voice Connector is pretty straight forward:

      • Voice Connector Name: This can be something that is for your reference, this isn't used anywhere. In my example, I called it UniFi Talk Trunk.

      • Encryption: This must be Disabled as the UniFi Talk Application does not currently support TLS through the interface.

      • Tags: This is optional, I elected not to add anything here.

  • Provision Phone Numbers

    • Note: It is possible to port numbers into Chime SDK, but this is done through a support ticket.

    • Step 1: From the Amazon Chime SDK landing page, select Phone Number Management.

    • Step 2: From the Orders tab, select Provision phone numbers.

    • Step 3: The phone number ordering process can be quickly accomplished:

      • Order Type: Voice Connector

      • Country: This is up to you, I selected United States based on what I am able to Order.

      • Type: Local or Toll-Free, your choice!

      • Area/Toll-Free Code: This is pretty self-explanatory, poke around and find a number that suits your use case.

      • Location/Area Code (State/City): If you select a Local number, this is just a way to narrow down the available numbers.

    • Step 4: You can order more than one number at the time, select the checkbox associated with each number you want to order.

      • Phone Number Detail - Name: Optional.

    • Step 5: Click Create Phone Number Order.

      • This process may take a few minutes to complete.

  • Configure the Voice Connector

    • Step 1: Navigate back to Voice Connectors, selecting the applicable Voice Connector you created earlier.

    • Step 2: Setup Termination

      • Termination is outbound calling from your UniFi Touch device out to the world

      • Step 2a: Select the Termination tab and click Enabled.

      • Step 2b: Configure Termination Settings:

        • Outbound host name: You will need to reference this for the UniFi Talk configuration.

        • Allowed hosts list: This should be the external IPv4 IP (or range) of your network.

          • You can always go here to find what your external IP is or reference your UniFi Network Controller interface.

        • Calls per second: This is your ability to control/restrict simultaneous outbound calls, AWS also have service quota limits that may override this.

        • Calling plan: Select the authorized countries that may be called.

        • Credentials: This is recommended, but ultimately optional.

          • Click New > create a unique set of credentials and keep these handy for the UniFi Talk configuration. Click Save.

        • Caller ID override: You can assign one of your provisioned phone numbers to be the default outbound caller id number.

      • Step 2c: Click Save.

    • Step 3: Setup Origination

      • Origination is the outside world's ability to call you.

      • Step 3a: Select the Origination tab and select Enabled.

      • Step 3b: Configure Origination Settings:

        • Inbound Routes: Click New to create a destination for the inbound calls to be routed to.

          • Host: This is either your IP or domain name of your UDM Pro or Talk Controller.

          • Port: For the purposes of this, we will use 6767, but this can be changed based on your requirements. This will need to be consistent between this and the UniFi Port Forwarding settings later on.

          • Protocol: UDP (I leverage UDP based on existing configurations I had from Twilio, YMMV with TCP)

          • Priority: If you are only leveraging a single route, this can be any number between 1 and 99, otherwise select a relative priority.

          • Weight: If you are only leveraging a single route, this can be any number between 1 and 99, otherwise select a relative weight.

        • Click Save.

      • Step 3c: Click Save.

    • Step 4: Assign Phone Numbers

      • Step 4a: Click the Phone Numbers tab, then Assign from inventory.

      • Step 4b: Select a phone number from the list of available and then Assign from inventory.

UniFi Talk Configuration

This is where things get interesting! There are two areas we need to configure the UDM, first the UniFi Talk application and then the Network Controller. Keep in mind that your configuration may be different. I also had been previously leveraging Twilio's Elastic SIP Trunking, so I hope I have gathered the relevant configurations, but please leave a comment below if I missed something! Keep in mind, I won't be covering general usage of Talk in this post, only how to setup the Service Provider and add phone numbers.

Configuring the UniFi Talk Service Provider

  • Step 1: Login to your UDM and navigate to the Talk application, then go to Settings using the gear icon, then System.

  • Step 2: Enable Static Signaling Port.

  • Step 3: Click Add Third-Party SIP Provider

  • Step 4: Configuring the Provider isn't terribly difficult, but the configuration is all based on custom fields.

    • Provider Name: Anything you'd like, my is simply named AWS.

    • Add Custom Fields: Add the following custom fields: ping, proxy, password, ping-max, ping-min, register, username, from-domain, enable-timer, session-timeout, caller-id-in-from, register-transport, minimum-session-expires.

    • Custom Field Values:

      • ping: 60

      • proxy: This is the value of the Outbound host name from your Termination configuration above.

      • password: password you provided during the Termination configuration above.

      • ping-max: 10

      • ping-min: 1

      • register: false

      • username: username you provided during the Termination configuration above.

      • from-domain: This is the value of the Outbound host name from your Termination configuration above.

      • enable-timer: true

      • session-timeout:900

      • caller-id-in-from: true

      • register-transport: udp

      • minimum-session-expires: 120

    • Destination Countries: You can limit this however you like, keep in mind you also set this value as part of the Calling plan in the Termination configuration above.

    • Handle All Outgoing Calls By Default: Your choice, if you are using other SIP providers, this may be applicable to you. If not, this is safe to check.

    • DID Numbers: This is a list of numbers from the assigned Phone numbers above, this needs to be in the formal E.164 format, so for US numbers, it would look like +12025551212.

    • IP Address Range: This is a bit more convoluted to determine, this is basically what IP addresses the UDM will permit to initiate inbound SIP traffic. Specific AWS IP ranges can be found here and searching for "CHIME_VOICECONNECTOR" and matching the region you Voice Connector is in.

      • For us-west-2 this is 99.77.253.0/24.

      • More information can be found here.

  • Step 5: Assign numbers to persons/phones.

UniFi Network Controller Configuration

Lastly, because we enabled the static signalling port, we need to create a port forward from the external port 6767 to the internal IP address of the Talk application.

  • Step 1: Navigate to the Network app, Settings using the gear icon, Security, Port Forwarding.

  • Step 2: Click Create Entry and configure the port forward:

    • Name: Any name you'd like, I used Talk

    • Forward Rule: Checked

    • Interface: Interface associated with the IP/domain entered into the Origination section above. (For most, this will be WAN)

    • Destination IP: Not Configurable

    • From: Any

    • Port: 6767

    • Forward IP: This is the internal address of your appliance, on my network it is 10.10.10.1, this can also be found as Gateway IP on the Talk homepage.

    • Forward Port: 6767

    • Protocol: UDP

    • Logging: Your choice if you want the forward to be logged.

  • Step 3: Click Add Entry.

Testing and Validation

  • Testing was pretty straightforward, called from my mobile phone to the newly provisioned DID and then returned the call after that was successful.

Challenges and Solutions:

    • One of the issues is that the UniFi Talk Controller does not currently support TLS configurations. Since I wanted to have this configuration survive updates, I kept the Voice Connector unencrypted.

    • I am using Comcast/Xfinity as my ISP and have dynamic IP assigned. Since much of this configuration is dependent on the WAN IP of the UDM, I am working on an easy (UniFi Network Controller supported) method of updating my Route53 DNS records so this can be a somewhat static value.

Benefits and Use Cases

Alright, let's talk about why mixing Amazon Chime SDK with UniFi Talk on your UDM Pro is not just cool but actually super useful. First off, this setup is like having your cake and eating it too. You get the robust, cloud-powered flexibility of Amazon Chime SDK and AWS, meaning you can have top-notch audio calls, integrate with other services such as Transcribe, Comprehend, Amazon Connect, all with the reliability and seamless integration of UniFi Talk and UDM Pro. It's a bit like turning your network into a communication superhero, ready to save the day, whether it's a general call or a high-powered GenAI sentiment analysis engine.

Use Cases

  • Small Business Revolution: If you're running a small business, this setup can transform the way you communicate with your team and clients. Imagine seamless meetings, flawless call handling, and an integrated system that just works.

  • Home Office Hero: For the remote workers among us, this is your ticket to professional-grade communications. No more dropped calls or glitchy video meetings.

  • Tech Tinkerers' Dream: Love playing with tech? This project is a perfect weekend challenge with a practical side. Impress your friends with your DIY communication hub.

Conclusion

So, there you have it – a tech journey of integrating Amazon Chime SDK with UniFi Talk on a UDM Pro, transforming the way we think about home and small business communication systems. It's not just about the cool factor (though let's be honest, that's definitely there); it's about creating a system that's robust, reliable, and ridiculously easy to use.

Whether you're a small business owner looking to upgrade your communication game, a remote worker in need of a better setup, or just a tech enthusiast eager for your next project, I hope this guide sparks some ideas and maybe even inspires you to take on this integration challenge. Remember, the world of tech is always evolving, and there's no limit to what you can create with a bit of curiosity and some elbow grease.

Thanks for sticking with me through this adventure. Got questions, or want to share your own experiences? Drop a comment below – I'd love to hear from you!

Further Reading/References