Day 2 - AWS Workshops Building Telephony-Powered Applications

Posted on August 11, 2022 by David Rowe ‐ 6 min read

Day 2 - AWS Workshops Building Telephony-Powered Applications

Day 2 of workshops

For my second day on workshops, I’ll be working through Building Telephony-Powered Applications with the Amazon Chime SDK PSTN Audio Service

Initial thoughts

I have no idea what I’m getting into for this workshop. I never use the Chime SDK and I do not know what PSTN even stands for….

Here we go.

Setting up Environment

Nothing unusual at the onset. I get to make a Cloud9 Environment in my AWS account.

  • My view of this Section: Neutral
  • My rated level: 100

Amazon Chime

Alas we find out what PSTN stands for on this section: Public Switched Telephone Network (PSTN). Seems it’s just AWS nomenclature for their method to work with Chime and Lambda.

Next we find out the components that are the building blocks of the PSTN audio service

pstn audio service chime

The telephony events are unrolled and described on the next page. I got to be honest, I have zero experience on this topic, and it doesnt make much sense at this point in time. Followed by the next page saying that you can do actions with lambda when people call in. I get it, I just dont get the process yet. Hopefully the lab gets me doing something later with this knowledge.

  • My view of this Section: Overwhelmed
  • My rated level: 100

Building my first PSTN audio application

Preparing the application

The first section has me selecting a lambda function from a repo. Nothing out of the ordinary and this seems all straight forward so far. I deployed the app and my arn for the lambda is close to this:

arn:aws:lambda:us-east-1:01234567890:function:serverlessrepo-amazon-chi-PSTNAudioWorkshopHandler-3HY6asYLTa0S

I get through this page/section and feel like I am a copy/pasta ninja. I do not know exactly how it links together at this point:

13745fcb-4d9b-4d1f-9e93-ad071cd2f49e

Next i’m off to make a phone number. I’m in Massachusetts, so i decide to find an MA number instead of a FL number. I dont really mind where the number is coming from inside of MA, so i simply use the code:

E164_PHONE_NUMBER=$(aws chime search-available-phone-numbers –country US –state MA –phone-number-type Local –max-results 1 –query E164PhoneNumbers –output text)

generate chime phone number

Following the next few steps, I seamlessly order a phone number. I get to move onto the next step of this section.

Well this section is seriously just copying and pasting. I’d like a diagram on this page to relate what I did to what I learned in the first section. I’d have to go backwards to get that info, which I plan on just lunging forward from here and continuing with the workshop.

Next I make an s3 bucket and apply a policy to the bucket. Based on the guide, when I attempt to put the policy on the bucket, I get the following error:

malformed resource bucket policy

I re-read the json and dont see a single thing wrong with it. Jumping over to the s3 console, I copy the arn of my bucket, paste it into the json where I received the error and re-run the code. This time I had no issues. Undoing and Re-doing, I see no change to the file… whatever. I keep plugging forward.

Review the code section took me through a mental stumbling block. It told me word for word: “On the next screen, your application code should be visible. Scroll down to review the code.” I shift my way down reading the lambda code and think “why would I do this on a 100 level workshop.” I go back into the workshop and find that they meant read through the workshop and we’ll explain the code to you. My bad! Review time.

  • My view of this Section: Positive
  • My rated level: 100

Step 1: The Speak Action

Following all instructions, I dial into my newly provisioned phone number and try to order a pizza. The Lambda function does exactly what it’s supposed to and tells me my phone number and then hangs up. The workshop then says I can look at the logs for the lambda function and doesnt point to cloudwatch logs or how to get them for the lambda function. This step is probably a 200 level step.

call details

  • My view of this section: Cool Stuff
  • My rated level: 100-200

Record Audio!

Changing the code is trivial. I did that no issue, and called into the number. I didnt read anywhere in the guide that it said I should go in and get the Action Successful key from the CloudWatch Event. Honestly I wanted this to show me where the file is and went and show the flow of the file into the S3 storage.

  • My view of this section: Middle of the road
  • My rated level: 100

PlayAudio

On this step, if I didnt have a small background in AWS I might have been a bit lost. I did save my ACTION_SUCCESSFUL key from the previous step, but that information wasnt outlined in the labs. Small hoop to jump through for new to cloud people.

  • My view of this section: Middle of the road
  • My rated level: 200

Speak and Get Digits

I found this section to be really enlightening. This section showed how you can link and use multiple items learned in the previous sections and link them all together. Nearing the end of the section, I was please to see that the code had a walk through and I was shown exactly how the lambda function did all it’s magic.

  • My view of this section: Excellent
  • My rated level: 100

Cleanup

I found this section to be easy to follow and all things cleaned up without any issue. I wish there was a copy all and paste section, instead of individually copying steps, but that is just a minor request.

  • My view of this section: Good
  • My rated level: 200

Fin

I finished it. All in all this workshop took me just over 1 hour to do and blog while doing it. I’m not sure when or where I can use this material, but someday I’m sure I’ll be able to hold a conversation and be at 100 level detail with a customer regarding chime SDK on Lambda.

  • Overall view of workshop: 4 out of 5 stars
  • My rating of skill needed to complete: 100 level.

Thats all. Onto the next one.

For an overview of all the workshops I’m doing,

Please view 100 Days of AWS Workshops →