My First Amazon Blog... ML/AI Chatbot over the Phone!

A month ago I told you I changed roles at AWS. Now I can show you what I’ve done since then!

I started a new role at AWS on November 1. I joined the Amazon Chime SDK team to form their Developer Advocacy/Technical Evangalism function. My job will be to help folks learn how to best use this amazing AWS service to revolutionize their communications. But what, exactly? Glad you asked.

My first official AWS blog posted last Monday, in sync with re:Invent. Yes, I was there - more on that later.
I am really proud of this blog, and even more proud of the code we open sourced that goes with it..

What is it? Machine Learning, baby! Well, kinda. The result of machine learning. Amazon Lex lets you build chatbots with conversational AI. My code lets you do that conversation over the phone! Think about that for a moment. You can sit down today and play with a demo that talks to you over the phone. How cool is that?

The rest of this is not about ML/AI Chatbots. Go check out my blog post for that! Please! And tell your friends! Share it around on social media!

The rest of this here today is about cloud telephony. It’s the foundation that I bolted Lex/Polly on top of. And it’s going to change the game.

But Wait, There’s More

If you know me at all then you know I’m all about automation. “Start with Deployment Automation and the software design falls out.” Apparently I said that years ago and someone repeated it back to me recently. That is indeed my philosophy. So it won’t surprise you that’s where I started with the Chime SDK. I’d been wanting to really dig into the AWS Cloud Development Kit (CDK) anyway and so I did. But that’s where I ran into my first block.

The Amazon Chime SDK is new enough that native Cloud Formation support is not done yet. So I did what any self-respecting geek with an automation bent would do: I created a CloudFormation Custom Resource Provider - called a Custom Resource Provider (CRP) - for the resources needed for the demo. In native typescript. And open sourced it. You can find it here.

This is in it’s Infancy - It’s Still a Work-in-Progress

It’s early days. The tool only creates one phone number, one SIP rule, and one SIP Media Appliance (SMA) today. It’s perfect for a demo. It lets you create the resources you need and more importantly when you are done it lets you delete them with a simple “cdk destroy” command. This is the power of the cloud folks: ephemeral resources.

Hold right there and think about that again. Use this code and you create a phone number. A real number you can dial with your phone and interact with. And when you are done you type a command it all vanishes. And you paid for only what you used, while you used it. That’s the essence of what I call “Cloud 1.0” thinking. Disposability is key to even starting to get the benefits of the Cloud. And we’ve now brought this to telephony!

For real production systems you don’t want your phone number to vanish back into a pool. You want to keep it. The provider code will have to evolve to support nested stacks or more. Folks will need the ability to create and update a whole telephony stack and just “release” the phone numbers from connection to code and keep them allocated. This logic will all need to be added to the CRP code.

And that is where you can come in. This code is open source, licensed under the business-friendly MIT-0 license.

Pull Requests welcome! Come play!

Yes. Terribly Low-Level Though. What Can I Build TODAY?

If you know me at all, you also know that’s what I knew you would ask. Building a cool demo that talks to you and building a cool CRP to help you automate deployment were necessary, but not sufficient. Not for me, and it should not be for you either. So I built a template starting point that uses the CRP and does the most basic telephony thing possible: answer the phone and tell you the time. Old farts like me will remember that this was always the phone number “555-1212.” My example goes a little farther and reads your caller-id and knows if you have called before. It stores your number in DynamoDB. If you are a new caller, it speaks your number back to you.

This is all open sourced. You can clone the repos, set up your AWS account and try it all yourself. And better yet, you can start from there and derive like crazy to make your OWN telephony application. And if you do, drop me a note so I can help you share it around!

If You Are Even More Impatient: Call it NOW

That’s right! Call the US number:

+1-505-273-6307

Right now. DISCLAIMER: it’s up to you to understand if that will cost you money. Many plans in the US have no charge for long-distance calls, but if this costs you money it’s on you. The number was allocated from New Mexico USA, so it may well be long-distance for you. Please be wise.

Seriously. Don’t wait. Call it up. I’ll leave that deployed until folks stop calling it. Maybe I’ll leave it up forever. After all it’s cloud cheap! The pricing is currently $1/month for the phone number and $0.002 per minute for the call, plus a tiny cost for the lambda function and DynamoDB consumption. You could build a pretty powerful application for tens of dollars a year. Cloud economics at work!

Yes, But How Would I Really Do This?

It’s simple. Just replicate the template repo into your AWS account. You can see the new Github repo here. Clone the CRP as described in the README. Make sure you have a dependencies intalled like the README describes and then go into the template folder and typled “make deploy.” Here is the sum total of what I did after I clicked “Use this Template” in github into my own “simpleTest” repo:

git clone git@github.com:aws-samples/amazon-chime-sdk-pstn-provider.git
git clone git@github.com:gherlein/simpleTest.git
cd simpleTest
make deploy

It took a few minutes to deploy and I called the phone number it spit out in the output. It’s that easy to deploy. How’s that for deployment automation?

Easter Egg Bug Reward

I left something “wrong” in the implementation. Something simple, but obvious.

You can tell just by calling the number. Here’s my challenge: figure it out, and send me a Pull Request to fix it. There’s a reward involved, and not just the fame of contributing to such a ground breaking new technology! Don’t hold your breath though. I’m not rich. But you will like the reward! And it will be fun!

Conclusion

We are at the begining of a new age of communication. The phone system is still a core bedrock for most folks, but the Internet is a river of change. The Amazon Chime SDK melds those two worlds - in a very cloudy way. Ask yourself: what kind of things can you build with this? What simple customer interactions could you automate? I personally think there’s a huge cottage industry for custom software that helps small businesses automate how they interact with customers. If you are a builder, you might want to get it on this. It feels a lot like the early days of Linux.

Disclaimer: as usual, all opinions here are my own and not my employer.

Clicky

Clicky

 Share!