Twilio Markup TwiML Record Calls Code

How to Record Calls on Twilio with TwiML Automatically

TwiML is Twilio’s amazing markup language for quickly & efficiently deploying new complex voice & SMS services.

Twilio are cloud based software providers of phone systems both landline and mobiles. They even have MMS services that I will cover in later tutorial.

Do you want to record incoming phone calls automatically on Twilio? Read ahead.

First, you need to take advantage of Twilio’s TwiML which is their own markup/scripting language. We use their markup to quickly roll out functions for Twilio’s platform to perform.

First, create a TwiML Bin by going to the menu on the left > Runtime > TwiML Bins.

Twilio Record Calls Using TwiML
Twilio Record Calls Using TwiML

A TwiML Bin is a little notepad that you can write and save your set of instructions to. Better yet, TwiML will host that file for you.

1
2
3
4
5
<Response>
  <Dial record="record-from-answer">
      <Number>+1555555555</Number>
  </Dial>
</Response>

When somebody calls your TwiML number, this markup will tell TwiML to dial +155555555 and if someone answers the call, it will record the call to 155555555. This may be illegal in your country if neither party has consent of the recorded call.

Dial with the record=”record-from-answer” can also be set to record-from-ringing-dual if you want it to record before 155555555 even answers, or even if they don’t answer.

Twilio Markup TwiML Record Calls Code
Twilio Markup TwiML Record Calls Code

Leave a Reply

Your email address will not be published. Required fields are marked *