TUTORIAL Bitcall SIP Trunking: Connecting an Outbound SIP Trunk to an AI Voice Agent

Bitcall

New Member
Joined
Oct 2, 2026
Messages
1
Reaction score
0
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.

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) → PSTN

For Bitcall the trunk values are:
  • SIP server: gateway.bitcall.io, port 5060
  • 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 SDP c= 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 with Dial(PJSIP/${EXTEN}@bitcall-endpoint) using international-format numbers.

About Bitcall​

Bitcall is a prepaid telecom provider: A–Z VoIP termination and SIP trunking, plus a browser webphone, OTP numbers for SMS verification, travel eSIMs and HLR lookups. Accounts are self-service and prepaid by card, PayPal or cryptocurrency. Setup guides for Asterisk, 3CX and AI voice platforms are in the Bitcall help center.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top