Skip to main content

Overview

BYOC (Bring Your Own Carrier) lets you use your existing phone numbers and SIP trunks with TalkifAI — without porting numbers or changing carriers. This is useful if you:
  • Already have phone numbers with a carrier
  • Have existing SIP infrastructure
  • Need specific carrier features (e.g., local presence, number pools)

How BYOC Works

Your Carrier (Twilio/Telnyx/etc.)

         │  SIP Trunk

  LiveKit SIP Server (TalkifAI)


  Voice Agent Runtime


  AI Agent handles call
TalkifAI connects to your carrier’s SIP trunk. You point your carrier’s inbound calls to TalkifAI’s SIP endpoint and configure outbound calling credentials.

Phone Number Setup

Create a Phone Number

POST /v1/byoc/phone-numbers
{
  "phoneNumber": "+19876543210",
  "inboundAgentId": "agent_support",
  "outboundAgentId": "agent_sales",
  "sipUsername": "your_sip_username",
  "sipPassword": "your_sip_password",
  "terminationUri": "your-trunk.pstn.twilio.com",
  "friendlyName": "Main Support Line"
}
FieldRequiredDescription
phoneNumberYesE.164 format phone number
terminationUriYesYour carrier’s SIP termination URI
inboundAgentIdNoAgent for incoming calls
outboundAgentIdNoAgent for outgoing calls
sipUsernameNoSIP authentication username
sipPasswordNoSIP authentication password
SIP credentials are encrypted with Fernet before storage. They are never stored in plain text.

Update a Phone Number

PUT /v1/byoc/phone-numbers/{phoneNumber}
{
  "inboundAgentId": "agent_new_support",
  "sipPassword": "updated_password"
}

Delete a Phone Number

DELETE /v1/byoc/phone-numbers/{phoneNumber}
This removes the phone number and all associated SIP trunks from TalkifAI.

Trunk Management

Refresh Trunks for One Number

If a trunk has issues, recreate it:
POST /v1/byoc/trunks/refresh
{
  "phoneNumber": "+19876543210"
}

Refresh All Trunks (Bulk)

For system-wide maintenance or after SIP credential rotation:
POST /v1/byoc/trunks/refresh-all
Refreshing all trunks causes a brief interruption in call handling (typically under 30 seconds). Do this during off-peak hours.

Carrier Setup Guides

Twilio

1

Create Elastic SIP Trunk

  • Go to Twilio Console → Elastic SIP Trunking → Trunks → Create Trunk
  • Name it (e.g., TalkifAI)
2

Set Origination URI

Add TalkifAI’s SIP endpoint:
sip:livekit.talkifai.dev:5061;transport=tls
3

Set Termination URI

Note your Termination URI (e.g., your-trunk.pstn.twilio.com) Use this as terminationUri when creating the phone number in TalkifAI.
4

Add Credentials

Create a Credential List with username/password for outbound authentication.

Telnyx

1

Create SIP Connection

  • Go to Telnyx Portal → Voice → SIP Connections → Create
2

Point to TalkifAI

Set the SIP URI to:
livekit.talkifai.dev:5061
Enable TLS/SRTP for secure media.
3

Assign Phone Number

In Telnyx Portal, assign your phone number to the SIP Connection.

Security Best Practices

  1. Always use TLS — Add ;transport=tls to your SIP URIs
  2. Rotate SIP passwords regularly
  3. IP ACL — Whitelist TalkifAI’s IP ranges in your carrier settings
  4. Use SRTP — Encrypt media streams, not just signaling

Troubleshooting

ProblemLikely CauseFix
Calls not connectingWrong Origination URIVerify SIP endpoint in carrier settings
Authentication failedWrong SIP credentialsUpdate credentials in TalkifAI BYOC settings
Audio quality issuesNo TLS/SRTPEnable secure transport
Agent not answeringNo inbound agent assignedSet inboundAgentId for the phone number