How It Works
When you enable local presence:- The CLI extracts the recipient’s area code
- It searches your Twilio numbers for an exact match
- If no exact match, it finds the closest geographic number
- If no numbers are close, it falls back to your primary number
Prerequisites
- Multiple Twilio phone numbers in different area codes
- Numbers assigned to your Twilio account
- CLI configured with Twilio credentials
Provision Numbers
Buy Numbers in Target Area Codes
- Go to Twilio Console → Phone Numbers → Buy a number
- Search by area code for regions you call frequently
- Purchase numbers for your key markets
Recommended Area Codes
| Region | Area Codes |
|---|---|
| San Francisco Bay Area | 415, 650, 510 |
| Los Angeles | 213, 310, 818 |
| New York | 212, 646, 917 |
| Chicago | 312, 773 |
| Texas | 214 (Dallas), 713 (Houston), 512 (Austin) |
| Florida | 305 (Miami), 407 (Orlando) |
You don’t need every area code. Having 5-10 numbers across major regions
provides good coverage.
Enable Local Presence
Via Config
Per-Call Override
Enable for a single call:Use Local Presence
Basic Usage
With Contact
In Queues
Local presence works with queue dialing:Verify Local Presence
Check which number was used:from field in the output.
Geographic Matching
Exact Match Priority
If you have a number with the exact area code as the recipient, it’s always preferred.Proximity Fallback
Without an exact match, the CLI calculates geographic distance:- Looks up area code coordinates (lat/long)
- Calculates distance using Haversine formula
- Selects the closest number within ~100 miles
Fallback to Primary
If no numbers are within range, the primary number (twilio.phoneNumber) is used.
Area Code Database
The CLI includes a built-in database of US area code locations. No configuration needed. For international numbers, local presence still works but may have limited area code coverage.Best Practices
Coverage Strategy
- Buy numbers in your top 5-10 calling regions
- Consider where your prospects are located
- Update your number pool as you expand to new markets
Quality Over Quantity
- 5 well-placed numbers > 20 random numbers
- Focus on regions where you have the most prospects
- Monitor which numbers get the most use
Track Performance
Compare connect rates with and without local presence:Industry research shows local presence typically improves connect rates by
20-40%.
Troubleshooting
”No numbers available for local presence”
You need at least 2 numbers (primary + one alternate) for local presence to work.”Using primary number for all calls”
Your Twilio account may only have one number. Buy additional numbers in different area codes.”Unexpected area code selected”
The selection algorithm prioritizes:- Exact area code match
- Geographic proximity
- Primary fallback
Next Steps
- Set Up Twilio — Configure Twilio credentials
- Call Operations — Make calls with local presence
- Queue Management — Use local presence in queues