Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Receiving incoming calls in the browser


Now that you know how to place and disconnect calls from the browser, it's time for your browser to start receiving incoming calls. By the end of this recipe, you will be able to make a call into your browser from your phone.

Getting Started

We're going to set up our Twilio Client app to accept incoming calls. This involves making changes to our Twilio app in our Twilio account.

To begin receiving incoming calls, we have to set up the Twilio Client app by performing the following steps:

  1. Give the browser session a client name. The browser will use this name when it registers itself with Twilio.

  2. Set up Twilio Client to notify your browser session about incoming connections.

  3. Write a TwiML code that directs incoming calls to your browser session.

The complete code for this recipe can be found in the Recipe1 folder under Code.

How to do it…

We will be implementing the following steps to set up our own app to allow incoming calls into our browser:

  1. Firstly, since this...