GithubHelp home page GithubHelp logo

cachetwilioclient's Introduction

Setup

  1. Create an account on twilio
  2. Add a new phone number under the Manage Numbers Page. This will be the number you call from.
  3. Verify a new caller ID under the Verified Caller IDs Page. This will be the number you call to. If you have a trial account, you are only able to make calls to verified numbers.
  4. Fork this Repo and place the Twilio.Rest.Client.xml file on your Cache Server. Then use Cache Studio's Import tool (located under Tools > Import) to import Twilio.Rest.Client.xml. (Alternatively you could just copy the code from Twilio.Rest.Client.cls since it's just one file)
  5. Make sure you have an SSL Configuration defined. This can be done through the Cache Management Portal under System Administration > Security > SSL/TLS Configurations.

Usage

  1. Instantiate a new Twilio Client using the Account SID and Auth Token found here
	Set sid = "your_sid"
	Set token = "your_token"
	Set sslConfig = "name_of_your_ssl_config" //Step 5 of Setup
	Set twilio = ##class(Twilio.Rest.Client).%New(sid, token, sslConfig)

  1. Make a call
	Set from = "+18001234567" 				// Twilio phone from step 2 of Setup
	Set to = "+18008675309" 				// Verified caller ID from step 3 of Setup
	Set url = "http://demo.twilio.com/docs/voice.xml" 	// web page containing TwiML instructions
	Set response = twilio.Call(from, to, url)
	// optionally read/handle response

Twilio determines how the call is handled based on XML instructions called TwiML. You can see the instructions used in the above example by visiting http://demo.twilio.com/docs/voice.xml. Check out the TwiML docs to learn more.

To change how the call is handled, create your own webpage and have it return a set of TwiML instructions. Then pass that url to the Twilio.Rest.Client instead.

Happy coding!

cachetwilioclient's People

Stargazers

Ketzelle avatar Dmitry Maslennikov avatar

Watchers

James Cloos 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.