AI voice agents (Vapi, Retell, Dograh, LiveKit, Pipecat and similar) handle the conversation, but they still need a carrier to reach real phone numbers. Most platforms let you bring your own SIP trunk (BYOC). This page describes the problems that typically show up when an AI agent dials out over a SIP trunk, and how they are solved, using the Bitcall outbound SIP trunk as the example.
For Bitcall the trunk values are:
Dial with
The setup
The AI platform (or your own Asterisk/FreeSWITCH) sends the call to the carrier over SIP; the carrier delivers it to the phone network:AI platform or PBX → SIP trunk (carrier) → PSTNFor Bitcall the trunk values are:
- SIP server:
gateway.bitcall.io, port5060 - Authentication: SIP username and password with registration (UDP, TCP or TLS), or Trusted IP for a PBX on a static public IP (UDP, no registration). Use one method per SIP account, not both.
- Codec: G.711 (
ulaw/alaw) - Direction: outbound only (no DIDs yet)
Problem 1: the call connects but the agent hears nothing
The RTP audio is not reaching the AI media server. The usual causes are a private IP address advertised in the SDPc= line, or a firewall blocking the RTP/UDP port range. Advertise a reachable public IP and open the RTP ports. A codec mismatch gives the same symptom: many AI pipelines use G.711 μ-law internally, so the trunk endpoint must allow ulaw (for example allow=ulaw on an Asterisk PJSIP endpoint).Problem 2: calls drop after about 30–60 seconds
While the agent is generating a reply, little or no RTP may be sent. An SBC, NAT binding or RTP proxy with an inactivity timer can then decide the media is dead and release the call. Fixes:- Send RTP keepalives or comfort noise during silence (RFC 3389 comfort noise; RFC 6263 lists RTP keepalive methods). On Asterisk PJSIP this is
rtp_keepalive. - Raise any RTP inactivity timeout to at least 60 seconds.
- Check the NAT path as in Problem 1.
Problem 3: extra latency
Conversational AI needs the whole round trip to stay well under about 1.5 seconds, and most of that budget belongs to speech-to-text, the LLM and text-to-speech. The telephony layer should add as little as possible: use G.711 end to end to avoid transcoding, standard 20 ms packetization, RFC 2833 DTMF for IVR navigation, and a carrier route that is reasonably close to where the AI platform runs.Problem 4: caller ID rejected or replaced
Outbound caller ID (CLI) rules depend on the destination country and operator. Set the caller ID on the trunk or in the dialplan, present a number you are allowed to use, and check the destination's rules before a campaign.Example: Asterisk PJSIP trunk to Bitcall
Code:
[bitcall]
type=registration
outbound_auth=bitcall-auth
server_uri=sip:gateway.bitcall.io
client_uri=sip:[email protected]
[bitcall-auth]
type=auth
auth_type=userpass
username=YOUR_USERNAME
password=YOUR_PASSWORD
[bitcall-aor]
type=aor
contact=sip:gateway.bitcall.io
[bitcall-endpoint]
type=endpoint
aors=bitcall-aor
outbound_auth=bitcall-auth
disallow=all
allow=ulaw
allow=alaw
Dial(PJSIP/${EXTEN}@bitcall-endpoint) using international-format numbers.