Voice Overview

The Telnyx Call Control API provides easy integration of voice capabilities into your application, allowing you to programmatically control a call for a variety of use cases, including: 

  • Interactive Voice: Build branching IVR with a single command.
  • Enhanced Customer Service:  Precisely route calls to the most qualified agent.
  • Privacy and Security:  Conceal the phone numbers of buyers, users or employees
  • Two-Factor Authentication:  Use automated calling to validate a user
  • Engagement:  Keep customers abreast of changes to meetings, accounts, etc.
  • Media Forking: Move transcription or voice analysis to the cloud.

This getting started guide assumes you have created a Telnyx Mission Control accounts, and therefore covers the following topics:

  1. Create a Connection
  2. Integrate your Voice Application with Telnyx
  3. Reporting
  4. Debugging

Connection Creation

A user should first create a connection using the instructions below.  You can also refer to Connection Creation.  For a Call Control connection, a user should follow the steps below:

Click the "+ Add Connection" button near the top right corner of the CONNECTION page to create a new connection.

  1. Enter the name you wish to have for your connection.
  2. Select "Call Control" as the "Connection Type".
  3. Input your webhook URL and click Set Call Control Auth
  4. Optional: Enable a failover action “hang-up”, which will hang-up the call if no commands have been given after the specified amount of time.
  5. Click "Done"

Integrate your Voice Application with Telnyx

Webhooks

Your application will receive webhook notifications to the webhook URL you input above. These will come in this format:

{
    "record_type": "event",
    "id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
    "event_type": "call_initiated",
    "created_at": "2018-02-02T22:25:27.521992Z",
    "payload": {
       "to": "+12025550131",
       "start_time": "2018-02-02T22:25:27.521992Z",
       "from": "+1-202-555-0133",
       "call_control_id": "AgDIxmoRX6QMuaIj_uXRXnPAXP0QlNfXczRrZvZakpWxBlpw48KyZQ==",
       "connection_id": "7267xxxxxxxxxxxxxx",
       "call_leg_id": "428c31b6-7af4-4bcb-b7f5-5013ef9657c1",
       "call_session_id": "428c31b6-abf3-3bc1-b7f4-5013ef9657c1",
       "direction": "incoming",
       "state": "parked"
    }

Nearly every Call Control Command generates one or more Call Control Webhooks. You can find a complete list of Commands and their corresponding Webhooks here.  

Commands

All commands are sent to a https://api.telnyx.com endpoint, and the specific command is indicated by the URL.

For example, the Answer Call command is sent to https://api.telnyx.com/calls/{call_control_id}/actions/answer 

The call_control_id is included in every command but the Dial command, and notifies Telnyx which call leg you wish to control, and where in the Telnyx infrastructure that call leg is being managed.  

For an overview of commands, visit here.  For detailed call command information, visit here.   For detailed conference command information, visit here.  

An Example Call

Did this answer your question?