Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Modify Calls In Progress With C#

In this guide we’ll show you how to manipulate live phone calls using C#. We’ll also cover how to retrieve information about in progress and completed calls from your Twilio account.

The code snippets in this guide are written using modern C# language features and require the .NET Framework version 4.5 or higher. They also make use of the Twilio C# SDK.

Modifying Twilio phone calls in progress with C#

The simplest way to control the flow of a Twilio phone call is with TwiML itself.

You can use the "action" parameters of verbs like <Gather> and <Record> to tell Twilio to get new instructions from your applications during a call. You can also use the <Redirect> verb to explicitly tell Twilio to fetch new TwiML.

But sometimes you need to change a live phone call outside of Twilio’s normal request-response cycle. For those cases you can use "RedirectCall()" to tell Twilio to immediately change the TwiML it’s using in a phone call.


        To update a call in progress you must provide:

        • CallSid - Twilio returns a CallSid when you initiate an outgoing call. Twilio also includes the CallSid in its request to your application for an incoming call’s initial TwiML.
        • Url - The URL Twilio should use to request new TwiML from your application.

        Hanging up a call in progress

        Twilio will end phone calls for you when it encounters a <Hangup> verb or when it runs out of TwiML to process. But you can also end phone calls whenever you like by passing a "completed" status to a CallSid in progress.


              Check out Modifying Live Calls in the reference docs for more details.

              Where to next?

              Check out our tutorials to see full implementations of Twilio Voice in C# with ASP.NET.

              David Prothero Agustin Camino Andrew Baker Ricky Robinett Kevin Whinnery Kat King Rob Spectre
              Rate this page:

              Need some help?

              We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.