Documentation

Voice Channel Setup Guide

Configure Twilio to enable voice capabilities for your AI agents. Follow this guide to connect incoming phone calls to your AscenAI agents.

What You'll Need

  • A Twilio account (free trial available at twilio.com)
  • A voice-enabled Twilio phone number
  • Your Twilio Account SID and Auth Token
  • An active AscenAI subscription on a voice-enabled plan
1

Get Your Twilio Credentials

Account SID

Your Account SID uniquely identifies your Twilio account. It starts with AC followed by 32 hexadecimal characters.

Where to find it:

  1. Log in to the Twilio Console
  2. On the Dashboard homepage, look for "Account SID" near the top
  3. Click the eye icon to reveal, then copy it

Auth Token

Your Auth Token is like a password for your Twilio account. Keep it secure and never share it publicly.

Security Warning: Your Auth Token grants full access to your Twilio account. If you suspect it has been compromised, regenerate it immediately in the Twilio Console.

Phone Number

You need at least one voice-enabled phone number from Twilio. This is the number customers will call to reach your AI agent.

How to buy a number:

  1. In the Twilio Console, go to Phone Numbers > Manage > Buy a Number
  2. Search by country, area code, or capabilities
  3. Ensure "Voice" is checked under capabilities
  4. Click Buy to purchase (typically $1-15/month)
2

Configure Twilio Webhook URLs

Twilio uses webhooks to notify AscenAI when someone calls your Twilio number. You need to configure the webhook URL in your Twilio phone number settings.

Set the Webhook URL

In Twilio Console:

  1. Go to Phone Numbers > Manage > Active Numbers
  2. Click on the phone number you want to configure
  3. Scroll down to the Voice & Fax section
  4. Under "A call comes in", select Webhook
  5. Enter the webhook URL provided by AscenAI (found in your dashboard under Voice settings)
  6. Set the HTTP method to HTTP POST
  7. Click Save at the bottom

Webhook URL Format

The webhook URL typically follows this pattern:

https://api.ascenai.com/v1/voice/twilio/webhook/{your_tenant_id}

You can find your exact webhook URL in the AscenAI dashboard under Settings > Voice Channels.

Status Callback URL (Optional)

For call analytics and logging, configure the Status Callback URL:

https://api.ascenai.com/v1/voice/twilio/callback/{your_tenant_id}
3

Set Up Twilio Pay for Payments

Twilio Pay allows your AI agent to securely collect credit card payments over the phone using DTMF tones (keypad presses). This is useful for order confirmations, service payments, and subscription renewals.

Enable Twilio Pay

  1. In the Twilio Console, go to Explore Products > Pay
  2. Click Get Started to enable the Pay product
  3. Connect your payment processor (Stripe is recommended)
  4. Complete the PCI compliance questionnaire

Connect Stripe

  1. In the Twilio Pay setup, select Stripe as your payment processor
  2. You'll be redirected to Stripe to authorize the connection
  3. Log in to your Stripe account or create one
  4. Authorize Twilio to process payments through your Stripe account

Note: Twilio Pay uses secure DTMF tone collection. Card numbers are never transmitted through AscenAI's servers — they go directly from the caller's keypad to your payment processor. This ensures PCI compliance.

Configure Payment Amounts

Payment amounts and triggers are configured in your AscenAI agent's playbook. You can set:

  • Fixed amounts (e.g., "$50 consultation fee")
  • Dynamic amounts based on order details
  • Recurring payment authorizations
4

Connect Credentials in AscenAI

Once you have your Twilio credentials, add them to your AscenAI dashboard.

  1. Log in to your AscenAI dashboard
  2. Navigate to Settings > Voice Channels
  3. Enter your Account SID, Auth Token, and Phone Number
  4. Click Save & Test Connection
  5. If the test succeeds, your voice channel is ready

Success! After saving, test by calling your Twilio number. You should hear your AI agent's greeting. If not, check the troubleshooting section below.

?

Troubleshooting

I'm getting "Invalid Account SID" error

This usually means the Account SID was copied incorrectly.

  • Ensure the SID starts with AC
  • Check for extra spaces at the beginning or end
  • Verify you're using the SID from the correct Twilio account (not a sub-account)

Calls connect but I hear silence

This typically indicates a webhook configuration issue.

  • Verify the webhook URL is correctly set in your Twilio phone number settings
  • Ensure the HTTP method is set to POST
  • Check that your AscenAI voice channel is enabled and connected
  • Check Twilio's call logs in the Console for error details

"Authentication Error" in Twilio logs

Your Auth Token may be incorrect or expired.

  • Re-copy the Auth Token from the Twilio Console
  • If you recently regenerated your token, update it in AscenAI
  • Ensure you're not using the test credentials (they start with SK)

Twilio Pay is not collecting payments

Verify your payment integration is properly configured.

  • Confirm Twilio Pay is enabled in your Twilio account
  • Verify your Stripe account is connected and active
  • Check that your agent's playbook includes payment collection steps
  • Ensure the caller is using a touch-tone phone (DTMF capable)

High latency or poor audio quality

Audio quality issues can stem from network or configuration problems.

  • Check your internet connection stability
  • Ensure your Twilio number is in a region close to your customers
  • Consider upgrading to a Twilio Elastic SIP Trunking for better quality
  • Contact AscenAI support if the issue persists

Need Help?

If you're stuck or need assistance with your voice channel setup, our support team is here to help. Contact support if you need help with voice routing or number setup.