Set up the phone system that carries your customers’ calls.
Twilio is the phone network behind your platform. It owns the actual phone numbers your customers buy, and it carries every call between a real caller and their AI agent.This is the longest chapter in the course, and the one with the most exacting configuration. Work through it in order, and don’t skip the settings that look optional, because most of them are what stop calls from failing in ways that are hard to diagnose later.
Have your government ID nearby. Part of this chapter verifies your identity, and you’ll need to photograph it with your phone.
Go to twilio.com and click Start For Free in the top right corner.
Fill in your name, your professional Hostinger email and a password. The requirements are listed under the field and tick off one by one as you type. A CAPTCHA also runs on its own and shows a green Success! once it’s satisfied, with nothing for you to do.Check the box agreeing to Twilio’s legal terms. The Stay updated marketing checkbox below it is optional, so leave it unchecked if you’d rather not get their emails. Click Continue.
2
Verify your email
Twilio sends a code to your mailbox. Go to mail.hostinger.com, open the email and copy the code.
Paste it into the Enter verification code field on Twilio, then click Continue to set up 2FA.
3
Set up two-factor authentication
Unlike Vercel, this one is mandatory: Twilio requires two-factor authentication on every account.Check that the country in the small dropdown is correct, enter your phone number and click Send code via SMS.
A code arrives by text message and an Enter verification code field appears on the same page. Type the code in and click Verify.
4
Save your recovery code
Twilio shows a recovery code. This is what gets you back into your account if you ever lose access to your phone.Click the download button next to it and keep the file somewhere safe, alongside your other one-time credentials. Click Done.
Without this code, losing your phone means losing access to the account that owns your customers' phone numbers.
Twilio welcomes you by name and offers two plans, 30 days free trial and Pay as you go.The trial plan can only call a handful of verified numbers and gives you a single pre-assigned number, which would block both your own testing and your customers’ real calls. Pay As You Go has no monthly fee and charges only for what’s used, which fits a business where your customers pay you upfront.Select Pay as you go and click Continue.
2
Enter your account and tax details
For User type, select Individual. This avoids questions about business entities, tax IDs and registration that don’t apply unless you’ve incorporated a company.Enter your legal first and last names, then your address. This is your tax address, so use your real permanent one. The field labels change with the country you pick, showing Province and Postal code for Canada, State and ZIP for the United States, and so on.Click Next.
Twilio asks for real legal details because telecom regulators require every carrier to know who is sending calls through their network. It’s the same system that keeps spam and number spoofing in check, and it’s what makes your customers’ calls arrive normally instead of being silently flagged as suspected spam.
3
Set your balance and auto-recharge
For the starting balance, choose $20.Then check Enable auto-recharge and select the Low option in the dropdown, which tops you back up to $20 whenever your balance drops below $10. The exact numbers vary by country and currency, so pick the lowest tier offered.Auto-recharge matters because Twilio stops calls the instant your balance hits zero, even mid-conversation. Keeping it low means less of your money sits in Twilio, and less damage if something unexpected drains it.Click Next.
Low keeps your cash free while still preventing calls from cutting out.
4
Pay and finish
Enter your card number, expiration and security code, then click Upgrade.
An order summary appears. Check that auto-recharge says On, triggering below $10 and topping up to $20, then click Finish.
A final page confirms the upgrade and lists some free units Twilio adds on top of your balance. Click Start building.
Your account is upgraded, but it still can’t own phone numbers. Twilio requires a compliance profile before any account can buy one, which means your app can’t provision numbers for your customers until this is done.
1
Open Trust Hub
Click the Products & Services icon in the far left icon bar, the second one under the home icon. In the panel that opens, click Trust Hub to expand it, then click Profiles.
2
Choose Individual Profile
Two profile types are offered. You want Individual Profile, which is meant for sole proprietors, and that’s what you are unless you’ve registered a company. The Business Profile asks for company documentation you won’t have yet, such as a registration number and tax ID.If you do have a registered company, you can choose the Business Profile instead. Everything in this course works either way.Click Get Started on the profile you’ve chosen.
3
Consent to verification
A page explains that Twilio verifies your identity against government databases. Click Next.
The next page asks for your consent to be verified by Persona, Twilio’s verification partner, including the selfie you’ll take later. Twilio keeps that data for no more than three years and uses it only for verification. This is a standard part of telecom compliance, so click Next.
4
Fill in your details
For Compliance profile friendly name, use anything you like. It’s only a label to find this profile later and has no effect on the type of profile being created.Enter your first and last name exactly as they appear on your government ID, since Twilio matches them against it. Your email and phone should already be filled in.For Business title and Job position, enter your real role. If you’re working alone, Founder or Owner as the title and CEO as the position are accurate. Don’t inflate them, this is a regulatory declaration tied to your ID.Click Next.
5
Enter your home address
Twilio asks where your home address is located. Choose your country in the Address country dropdown and click Next.
Fill in your home address on the next page. PO boxes aren’t accepted, so use a real street address. Click Next.
6
Choose your ID
Twilio asks which country issued your government ID. Select it and click Next.
You’ll then see the documents Twilio accepts from that country. Click the one you actually have, such as a driver’s license or a passport.
The accepted documents change depending on the country you chose.
7
Move to your phone
Twilio now wants a photo of that document. Since you’re on a computer, click Continue on another device.
Continue on another device is what moves this to your phone.
A QR code appears. Scan it with your phone’s camera, or click Send Email to get a secure link instead. Nothing needs installing on your phone.Then follow the instructions on your phone to photograph your ID and take a selfie. They adapt to the document you chose.
Have your phone and your ID ready before starting this part.
8
Confirm approval
Once you finish on your phone, return to your computer. The page moves on by itself and should show that your primary compliance profile has been approved.Approval is usually immediate. If yours comes back pending, a person is reviewing it, and you can carry on with the rest of this chapter while you wait. You only need the approved profile once you start buying phone numbers.Click Next.
A SIP trunk is the connection between Twilio’s phone network and Retell’s AI. Without it, a call would reach your customer’s number and find nothing on the other end.
1
Open Elastic SIP Trunking
In the same Products & Services panel you used for Trust Hub, scroll down to Elastic SIP Trunking, click it to expand, then click Trunks.
Click Create new SIP trunk.
Give it a clear name, such as SIP-trunk-yourdomain, and click Create.
2
Configure the general settings
You’ll land on the trunk’s General page. Four settings need changing, and each one prevents a specific failure:
Enable Call Transfer (SIP REFER), which lets an agent hand a caller over to a human
Set Caller ID for Transfer Target to Set caller ID as Transferee
Check Enable PSTN Transfer, so transfers can reach ordinary phone numbers rather than only internet ones
Enable Symmetric RTP, which keeps audio flowing when a network sits behind a firewall
Symmetric RTP is the one to be careful about. Without it you get calls that connect normally but have no sound, which is far harder to diagnose than a call that simply fails.
Click Save, then copy the Trunk SID shown just under the friendly name using the copy icon beside it.In Vercel, open your project’s Environment Variables, find TWILIO_TRUNK_SID, click the three dots, click Edit, paste it and click Save.Once that’s saved, come back to Twilio and click the Termination tab at the top of the trunk page, which is where the next section continues.
All four settings matter, and the Termination tab at the top is where you go once you've saved.
These two pages control the two directions of a call: termination is calls going out through Twilio, origination is calls coming in and being handed to Retell.
1
Set your termination URI
In the Termination SIP URI field, type a unique subdomain using lowercase letters and numbers, ideally based on your domain, for example implai-trunk. You only type that part: the .pstn.twilio.com ending is fixed and already shown to the right of the field.This subdomain has to be unique across all of Twilio, so if it says the name is taken, add a few characters until it’s accepted.In Vercel, find TWILIO_SIP_TRUNK_URI and enter the full address this time, meaning your subdomain plus the .pstn.twilio.com ending, then come back to Twilio.
2
Restrict who can use your trunk
Still on the Termination page, scroll down to the Authentication section and click the + next to IP Access Control Lists.This is what stops anyone else from placing calls through your trunk at your expense. Only Retell’s servers should be allowed.
The URI shows as available at the top, and the + you need is in the Authentication section below.
A dialog opens. Give the list a name such as default ACL, then enter Retell’s address in two parts, since the form splits it:
Field
Value
CIDR Network Address
18.98.16.120
Prefix dropdown
30
Click Create ACL.
The address and its prefix go in separate fields.
Your list now appears under IP Access Control Lists. Leave Credential Lists empty, since you’re authenticating by address instead. Click Save, then open the Origination tab.
3
Point incoming calls at Retell
On the Origination tab, click the + button to add an origination URL.
Fill the dialog that opens with these values:
Field
Value
Origination SIP URI
sip:sip.retellai.com
Priority
10
Weight
10
Enabled
on
Make sure Enabled is turned on. If it isn’t, Twilio simply won’t pass incoming calls to Retell, and your customers’ agents will never answer.
Click Add, then click Save back on the Origination page.
When a customer runs out of minutes, callers need to hear something rather than silence. This is that message.
1
Open TwiML Bins
In the far left icon bar, click the Develop icon, the one that looks like </>. In the panel that opens, click TwiML bins.
Click Create new TwiML Bin.
2
Add the message
Name it something recognisable such as Out-of-minutes-message.In the body, put your cursor at the end of the first line, press Enter, and paste this on the second line:
<Response> <Say voice="man">We're sorry, but this service is temporarily unavailable due to insufficient account balance. </Say> <Hangup/></Response>
Twilio confirms underneath with Valid Voice TwiML. Click Create.
3
Save its address
A URL appears at the top of the page. Copy it with the icon beside it, then in Vercel find TWILIO_OUT_OF_MINUTES_TWIML_URL, paste it and save.Once that’s done, look at the very bottom of the Twilio page for a small tab with an upward arrow. That’s where the last section picks up.
The tab at the bottom of the page is where your account credentials live.
Your phone system is fully configured: calls can come in, reach your customers’ agents, transfer to humans, and fall back to a message when minutes run out. One provider left, Stripe, which is how you actually get paid.