Overview
This guide explains how to connect your Telnyx account to Smallest AI using SIP Connections. Telnyx provides flexible, global SIP trunking with competitive pricing and excellent call quality.Prerequisites
Before you begin, make sure you have:- An active Telnyx account
- Access to the Telnyx Portal
- Phone numbers in your Telnyx account (or ability to purchase new ones)
Step 1: Create a SIP Connection
- Log in to the Telnyx Portal
- Navigate to Connections in the left sidebar
- Click Create Connection
- Select SIP Connection as the connection type
- Give your connection a descriptive name (e.g., “Smallest AI Connection”)
- Click Create
Step 2: Configure Inbound Settings
Inbound settings control how incoming calls to your Telnyx numbers are routed to Smallest AI.Set Up Inbound Routing
- In your SIP connection, click on the Inbound tab
- Under Inbound Settings, find the SIP URI section
- Add a new SIP URI destination pointing to Smallest AI:
- Set the routing priority and weight if needed (default values work well)
- Click Save
Configure Codec Preferences
- In the same Inbound tab, scroll to Codecs
- Ensure the following codecs are enabled:
- G.711 (PCMU/PCMA)
- Opus (recommended for best quality)
- Save your codec preferences
Enable DTMF
- Under DTMF Settings, select your preferred DTMF method:
- RFC 2833 (recommended)
- SIP INFO
- Save your settings
Step 3: Configure Outbound Settings
Outbound settings control how calls from Smallest AI are sent through Telnyx to the PSTN.Note Your Outbound SIP URI
- In your SIP connection, click on the Outbound tab
- Find and copy your Outbound SIP URI
- It will look like:
sip.telnyx.com
or similar - You’ll need this when importing numbers on Smallest AI
- It will look like:
Configure Authentication
Choose your authentication method:Option 1: IP Authentication
- In the Outbound tab, go to Authentication
- Select IP Authentication
- Add Smallest AI’s IP ranges if available
- If no fixed IP ranges are provided, enable authentication without IP restrictions
Telnyx may require credential-based authentication if IP authentication cannot be configured. Check with
Telnyx support for the best approach.
Option 2: Credential-Based Authentication (Recommended)
- In the Outbound tab, go to Authentication
- Select Credential Authentication
- Click Create Credential
- Enter a Username and Password
- Save the credentials
- Make note of both - you’ll need these when importing the number on Smallest AI
Set Outbound Voice Profile
- In the Outbound tab, configure Outbound Voice Profile
- Set the preferred codec order:
- Opus
- G.711 (PCMU/PCMA)
- Enable SRTP if required by your use case
- Save your settings
Step 4: Configure Technical Settings
Set Media Handling
- In your SIP connection settings, go to Media Handling
- Configure the following:
- Media Mode: Set to “Media Proxy” or “Direct Media” based on your needs
- T.38 Fax: Disable unless you need fax support
- Save your settings
Configure Caller ID Settings
- Go to Caller ID settings in your connection
- Enable Caller ID Name (CNAM)
- Configure how outbound caller ID should be presented
- Save your settings
Step 5: Assign Numbers to the Connection
Now link your phone numbers to this SIP connection.For Existing Numbers
- Navigate to Numbers → My Numbers in the left sidebar
- Find the number you want to use with Smallest AI
- Click on the number to edit it
- Under Connection, select your newly created SIP connection
- Configure the Connection Type as “SIP”
- Save your changes
For New Numbers
- Navigate to Numbers → Search & Buy Numbers
- Search for numbers by:
- Country
- Area code
- Number pattern
- Purchase your desired number
- During or after purchase, assign it to your SIP connection
- Configure as a SIP connection
Step 6: Import Numbers on Smallest AI
Now that your Telnyx connection is configured, import your numbers into Smallest AI.- Navigate to Phone Numbers in your Smallest AI dashboard
- Click Buy Numbers button
- Select the Import SIP Number tab
-
Fill in your number details:
-
Phone Number: Your Telnyx number in E.164 format
- Example:
+12025551234
for a US number - Example:
+442071234567
for a UK number
- Example:
-
SIP Termination URL: Your Outbound SIP URI from Step 3
- Example:
sip:sip.telnyx.com
- Or your specific Telnyx SIP URI
- Example:
-
Display Name (Optional): A friendly name for this number
- Example: “Customer Service Line”
- Username: Your SIP credential username (if using credential-based auth)
- Password: Your SIP credential password (if using credential-based auth)
-
Phone Number: Your Telnyx number in E.164 format
- Copy the SIP Origination URL shown (this should already be configured in Step 2)
- Click Add Custom Number
Make sure the phone number you enter matches exactly with the number in your Telnyx account, including the
country code and format.
Step 7: Test Your Setup
After importing your number:- Go to your agents in Smallest AI dashboard
- Assign the imported Telnyx number to one of your agents
- Make a test inbound call to your Telnyx number
- Verify that the call connects to your AI agent
- Test an outbound call from your agent
- Verify audio quality in both directions
Troubleshooting
Inbound Calls Not Connecting
Check Inbound Routing:- Verify the SIP URI in Telnyx points to:
sip:5rdbhjuwtlk.sip.livekit.cloud
- Ensure there are no typos or extra spaces
- Confirm the number is assigned to the correct SIP connection
- Verify the number is active in Telnyx
- Ensure the number is linked to your SIP connection
- Check that connection settings are saved
Outbound Calls Failing
Verify Termination URI:- Ensure the SIP Termination URL in Smallest AI is correct
- Use the exact URI provided by Telnyx (e.g.,
sip:sip.telnyx.com
) - Remove any trailing spaces or incorrect protocols
- If using credentials, verify username and password are correct
- Ensure credentials are enabled in your Telnyx connection
- Try recreating credentials if authentication continues to fail
- Check that your Telnyx account has permissions for the destination country
- Enable international calling if needed in Telnyx settings
One-Way Audio Issues
Check Media Settings:- Verify Media Mode is set correctly in your connection
- Try switching between “Media Proxy” and “Direct Media”
- Ensure firewall allows RTP traffic
- Verify common codecs are enabled (G.711, Opus)
- Check that codec negotiation is working properly
- Review call logs in Telnyx for codec mismatches
Call Quality Problems
Optimize Codec Selection:- Prioritize Opus for better quality
- Ensure G.711 is available as fallback
- Disable unnecessary codecs
- Verify network bandwidth is sufficient
- Check for packet loss or high latency
- Consider using a closer Telnyx edge location
- If enabled, ensure both sides support SRTP
- Try disabling SRTP to isolate the issue
- Contact support if SRTP is required but causing problems
Authentication Errors
“401 Unauthorized” or “403 Forbidden” errors:- Verify credentials are correct in Smallest AI
- Check that credentials are enabled in Telnyx connection
- Ensure authentication method matches (IP vs. credential)
- Verify IP ranges are configured correctly
- Check if Smallest AI’s IPs are allowed
- Consider switching to credential-based authentication
Advanced Configuration
Call Recording
Enable call recording in Telnyx:- In your SIP connection, go to Call Recording
- Enable recording for inbound and/or outbound calls
- Configure recording format (WAV or MP3)
- Set recording storage preferences
- Save your settings
Call recording in Telnyx is separate from Smallest AI’s recording features. You can use both or choose one
based on your needs.
Failover Configuration
Set up failover for high availability:- Create a secondary SIP connection as backup
- In your primary connection’s Inbound settings, add failover rules
- Configure failover timeout and retry logic
- Assign numbers to both primary and failover connections
- Test failover by temporarily disabling the primary connection
Emergency Calling (E911)
Configure emergency calling for US numbers:- Navigate to Numbers → My Numbers
- Select each number that needs E911
- Click Emergency Settings
- Enter the emergency address associated with the number
- Verify and save the address
E911 configuration is required for US phone numbers. Failure to configure properly may result in emergency
calls not being routed correctly.
Caller ID Management
Control how your caller ID appears:- In your SIP connection, go to Caller ID
- Configure Caller ID Name (CNAM)
- Set up caller ID for outbound calls:
- Use the calling number as caller ID
- Or specify a custom verified caller ID
- Save your settings
International Calling Setup
Enable international calling:- Navigate to Settings → International Calling in Telnyx portal
- Review the list of available countries
- Enable the countries you want to call
- Review associated rates
- Set spending limits if desired
- Save your settings
Monitoring & Analytics
View Call Logs
Monitor your calls in Telnyx:- Navigate to Reports → Call Detail Records (CDR)
- Filter by:
- Date range
- Phone number
- Call direction (inbound/outbound)
- Call status
- Export CDR data for analysis
Real-Time Monitoring
Use Telnyx’s real-time monitoring:- Go to Reports → Real-Time Dashboard
- View active calls
- Monitor call quality metrics
- Check for errors or issues
Set Up Alerts
Configure alerts for important events:- Navigate to Settings → Notifications
- Enable alerts for:
- Failed calls
- High call volume
- Account spending limits
- Configure notification channels (email, SMS, webhook)
- Save your alert settings
Cost Considerations
When using Telnyx with Smallest AI: Telnyx charges:- Monthly number rental fees (typically lower than competitors)
- Per-minute outbound call costs (competitive rates)
- Inbound call costs (typically very low)
- Optional features (call recording, CNAM, etc.)
- Standard per-minute call rates for AI conversation
- No additional fees for SIP trunk configuration
- No monthly rental fees for imported numbers
Best Practices
- Use credential-based authentication for better security than IP-based
- Enable Opus codec for optimal voice quality
- Set up monitoring to track call quality and issues
- Configure E911 properly for US numbers (legal requirement)
- Test failover scenarios to ensure high availability
- Monitor CDR regularly to catch issues early
- Keep credentials secure and rotate them periodically
Need Help?
If you encounter issues not covered in this guide:- Email Support: support@smallest.ai
- Include in your message:
- Your Telnyx phone number
- Your SIP Termination URI
- Description of the issue
- Any error messages you’re seeing
- Join our Community: Discord
- Telnyx Support: For Telnyx-specific issues, contact Telnyx Support
Related Documentation
- SIP Trunking Overview - General SIP trunking concepts
- Phone Numbers - Managing phone numbers on Smallest AI
- Telnyx Documentation - Official Telnyx developer docs