TeXML Quickstart: Simple Voicemail and Call Forwarding

TeXML is an XML-based data structure you can use to control calls with Telnyx and is the quickest way to get started with Call Control using a simple .xml file, allowing you to specify call instructions in your file using commands called verbs and nouns. TeXML Translator starts at the top of your TeXML file and executes your TeXML commands sequentially in the order they are arranged in the file.

In this guide, you'll learn how to setup a simple voicemail and call forwarding TeXML application using Telnyx Call Control.

This tutorial assumes that you have set up a Telnyx portal account, bought a phone number, and assigned it to a Call Control applciation. To get started, take a look at our Quickstart Guide.

Let's get started

Step 1: Create your XML

Simple Voicemail

<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <Say>Thank you for calling YYZ co. Please leave a message.</Say>
   <Record playBeep="true" finishOnKey="*9" />
</Response>

Simple Call Forward

<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <Dial>
  <Sip>[email protected]</Sip>
  <Sip>[email protected]</Sip>
  <Sip>[email protected]</Sip>
   </Dial>
</Response>

Step 2: Upload it to Telnyx, using the Media Storage API

There are many ways to upload your media to Telnyx. In this example, we'll upload the media via multipart.

curl --location --request POST 'https://api.telnyx.com/v2/media' \
--header 'Authorization: Bearer [REDACTED]' \
--form '[email protected]"/Users/localadmin/Desktop/vm.xml"'
{
"data": {
"created_at": "2021-09-23T17:18:31.704021Z",
"expires_at": "2021-09-25T17:18:31.186997Z",
"media_name": "01b654ed-c235-45b2-a1b0-9fc880c6d2c7",
"updated_at": "2021-09-23T17:18:31.704021Z"
}
}

Step 3: Setup your XML application using the Telnyx portal

Using the media name returned, you can set up your XML application.

Note that this feature is currently only enabled on one of our anchorsites- Ashburn, VA. You'll need to anchor your application to this site.

Editing your TeXML Application

Editing your TeXML Application

Set your Anchorsite

Set your Anchorsite to Ashburn, VA

Step 4: Test your Application

It's time to test your application:

  1. Assign a phone number to the application

Assigning a number to an application

Assigning a number to an application

  1. Dial the number from the PSTN and leave a message
  2. Retrieve your voicemail

Retrieving your Voicemail

Retrieving your Voicemail

And that's it! If you have any questions about this tutorial or any of our products, reach out to our support team through the chat in the bottom right hand corner.

Was this page helpful?