Code Monkey home page Code Monkey logo

thirdcall's Introduction

Third Call

This an incremental improvement to secondCall. It includes a CDK script to manage all the needed AWS infrastructure and a lambda function that does the work.

Deploying this will deliver a solution that has a single phone number. Call that number and the app will determine if that number has called before. If not, it will tell you what number you dialed from and the time, then hang up. If it detects that you have called previously it will just tell you the time and hang up. It stores that state in DynamoDB.

Under the hood this app deploys a SIP Media Appliance (SMA), a SIP Rule, and a Phone Number. These will cost money! When you are done with this demo you can delete it all with

make destroy
make delete-chime

The "make destroy" will invoke a custom resource from chime-cdk-support. At this time it does not fully support deletion. That is why the second command is needed, that does the work using the AWS CLI.

Incremental Improvements

I moved all the Chime and harder AWS service interfaces into a submodule "chill" to abstract away those complexities. In the future that will become a Lambda Layer. You can see more about the Chill library here.

Cloning to get Submodules Automatically

To get all the code for this project, clone the repo with this:

git clone --recurse-submodules --remote-submodules [email protected]:gherlein/thirdCall.git

That will pull the main repo and checkout the submodules in one step.

Installing Dependencies

After cloning, to the following to get all the needed modules and then test your build:

make modules
make build

The "make build" will run the typescript compiler for the CDK. It does not deploy the solution.

Usage

To deploy the solution:

make deploy

and it will deploy the CDK and output some variables, including a phone number. Call that number from your phone.

You can clean up everything with:

make destroy

However, the submodule "chime-cdk-support" is not yet fully supporting deletion of Chime resources. The makefule supports an extra step to delete he Phone Numbers, SIP Rules, and SMA by:

make delete-chime

Other Helpers

You can get a tail on the logs with:

make logs

These update fairly slowly so be patient and wait 60 seconds if you think it's not working.

If you prefer a bit nice watch on the logs, install saw and then:

make watch

Invoking just the lambda function directly without going through the SMA

You can test the functionality of the lamba directly by:

make invoke

This will use the file "test/in.json" as a sample input to the function. This is useful to ensure that your code is actually invoking properly with no javascript errors.

thirdcall's People

Contributors

gherlein avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.