Learn how to use Twilio Client to make browser-to-phone and browser-to-browser calls with ease. The unsatisfied customers of the Birchwood Bicycle Polo Co. need your help.
This project is configured to use a TwiML App, which allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.
Create a new TwiML app at https://www.twilio.com/user/account/apps/add and use its Sid
as the TWIML_APPLICATION_SID
environment variable wherever you run this app.
See the end of the "Local development" section for details on the exact URL to use in your TwiML app.
Once you have created your TwiML app, configure your Twilio phone number to use it (instructions here). If you don't have a Twilio phone number yet, you can purchase a new number in your Twilio Account Dashboard.
-
First clone this repository and
cd
into its directory:git clone [email protected]:TwilioDevEd/browser-calls-csharp.git cd browser-calls-csharp
-
Create a copy of
BrowserCalls.Web/Web.config.sample
and rename it toBrowserCalls.Web/Web.config
. -
Open
BrowserCalls.Web/Web.config
and update the following keys:<appSettings> <!-- omitted for clarity --> <add key="TwilioAccountSid" value="TWILIO_ACCOUNT_SID" /> <add key="TwilioAuthToken" value="TWILIO_AUTH_TOKEN" /> <add key="TwiMLApplicationSid" value="TWIML_APPLICATION_SID" /> <add key="TwilioPhoneNumber" value="TWILIO_PHONE_NUMBER" /> </appSettings>
-
Build the solution.
-
Run
Update-Database
at Package Manager Console to execute the migrations. -
Run the application.
-
Check it out at http://localhost:9932
That's it!
To actually forward incoming calls, your development server will need to be publicly accessible. We recommend using ngrok to solve this problem.
Once you have started ngrok, update your TwiML app's voice URL setting to use your ngrok hostname, so it will look something like this:
http://<your-ngrok-subdomain>.ngrok.io/Call/Connect
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.