Code Monkey home page Code Monkey logo

twilio_call's Introduction

Guiles-Theme-Phone-Calls-In-ES6

Quick ES6 code to make and receive calls that play Guile's Theme over the phone using the Twilio Node.js module.

Installation

Standard installation:

yarn
yarn upgrade

In you have not done that already, install Babel globally. This will allow you to use the babel-node command line tool to run ES6 scripts directly.

npm i -g babel-cli

Also, you need to install babel-preset-env:

yarn add babel-preset-env -D

and add the following code to your .babelrc file:

{
  "presets": [
    ["env", {
      "targets": {
        "node": "current"
      }
    }]
  ]
}

Run

babel-node index.js

Test

Open up a new terminal window and try hitting it with curl to make sure everything is working and we receive XML as a response:

curl -X POST http://localhost:3000/voice

The response should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<Response><Play>http://ocrmirror.org/files/music/remixes/Street_Fighter_2_Guile%27s_Theme_Goes_with_Metal_OC_ReMix.mp3</Play>
</Response>

ngrok

Install globally:

npm i -g ngrok

Start ngrok listening on port 3000:

ngrok http 3000

twilio_call's People

Contributors

sagnew avatar

Watchers

James Cloos avatar Andre Roussakoff 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.