Add a SIP Trunk¶
A SIP trunk is the connection between UnifiedBX and a SIP carrier (ITSP). New trunks on UnifiedBX are PJSIP by default — chan_sip is legacy and should only be used if a carrier explicitly requires it.
Before You Start¶
- The carrier has provided: SIP server FQDN/IP, port (5060 default), authentication method (registration credentials OR IP authentication), DIDs they will route to you.
- The carrier knows your UnifiedBX public IP (for IP-auth trunks).
- Your firewall allows SIP signaling from the carrier's IPs (see System Admin → Firewall → Networks/Trusted Zones).
Steps¶
- Go to Trunk Attributes → Trunks.
- Click + Add Trunk → Add SIP (chan_pjsip) Trunk.
- General Tab:
- Trunk Name — internal label, e.g.
Carrier-Voipms-Primary. No spaces. - Hide CallerID —
Nounless you want all outbound from this trunk to be private. - Outbound CallerID — default CID this trunk presents on outbound calls (overridden by route/extension CID per the resolution chain — see Configure Caller ID).
- CID Options —
Allow Any CID(default),Force Trunk CID(override everything), orBlock Foreign CIDs. - Maximum Channels — concurrent call cap. Set per the carrier's purchased channel count.
- Asterisk Trunk Dial Options — usually leave blank.
- Continue if Busy —
No. - Disable Trunk —
No.
- Trunk Name — internal label, e.g.
- PJSIP Settings → General Tab:
- Username — auth username from the carrier (for registration trunks).
- Secret — auth password.
- Authentication —
Outboundfor register-based;Nonefor IP-auth. - Registration —
Sendfor register-based;Nonefor IP-auth. - SIP Server — carrier hostname or IP, e.g.
sip.voip.ms. - SIP Server Port — usually
5060, sometimes5061(TLS). - Context — leave at
from-pstn(default). - Transport —
udp(default),tcp,tls, or0.0.0.0-udp.
- PJSIP Settings → Advanced Tab (only if needed):
- From Domain — set if the carrier requires a specific From: domain.
- From User — usually leave blank or match Username.
- DTMF Mode —
RFC 4733for most carriers. - Codecs — match what the carrier supports (commonly
ulaw,alaw). - Qualify Frequency —
60seconds is fine.
- PJSIP Settings → Codecs Tab — confirm/restrict to what the carrier supports.
- Click Submit.
- Click Apply Config.
Verify¶
asterisk -rx "pjsip show endpoints" | grep -A2 <trunkname>
asterisk -rx "pjsip show registrations"
For registration trunks, look for Registered. For IP-auth, the endpoint should show Available when the carrier sends a qualify.
Place a test outbound call from an extension that uses a route pointing at this trunk.
Common Issues¶
- Registration shows
RejectedorForbidden(403). Wrong username/secret, or the carrier hasn't whitelisted your IP. Re-check credentials and confirm the IP they have on file. - Outbound calls fail with "all circuits busy." Trunk is offline (registration failed or IP-auth not working). Check
pjsip show endpoints. - One-way audio. NAT issue. Set the External Address in System Admin → Sysadmin → Network Settings OR add NAT to the trunk's PJSIP advanced settings (
force_rport=yes,rewrite_contact=yes). - Calls connect but drop after 30 seconds. Asymmetric audio or RTP timeout. Check firewall RTP port range (10000-20000 by default).
- Choose between Username/Secret OR IP-auth — not both. Setting Username and not setting Authentication=Outbound causes confusion.