Asterisk PJSIP SIP Trunk Setup: Working Config for Wholesale Voice (2026)
Copy-paste PJSIP configuration to connect Asterisk to a wholesale SIP trunk: registration or IP auth, endpoint, dialplan with route prefixes, codecs and fixes for 401/403.
Copy-paste PJSIP configuration to connect Asterisk to a wholesale SIP trunk: registration or IP auth, endpoint, dialplan with route prefixes, codecs and fixes for 401/403.
To connect Asterisk (PJSIP) to a wholesale SIP trunk you need four blocks in pjsip.conf — registration, auth, aor and endpoint — plus one dialplan line that sends the full international number. If you use IP authentication, skip registration and auth.
sip.voxiotelecom.com, port 5060 UDP[voxio-reg]
type=registration
outbound_auth=voxio-auth
server_uri=sip:sip.voxiotelecom.com:5060
client_uri=sip:USERNAME@sip.voxiotelecom.com:5060
[voxio-auth]
type=auth
auth_type=userpass
username=USERNAME
password=PASSWORD
[voxio]
type=aor
contact=sip:sip.voxiotelecom.com:5060
[voxio]
type=endpoint
context=from-voxio
disallow=all
allow=ulaw,alaw,g729
outbound_auth=voxio-auth
aors=voxio
from_user=USERNAME
direct_media=no
For IP authentication, remove the registration and auth sections and outbound_auth. Your public IP must match the IP saved on the trunk exactly.
[from-internal]
exten => _X.,1,Set(CALLERID(num)=4930123456789)
same => n,Dial(PJSIP/${EXTEN}@voxio,60)
same => n,Hangup()
Dial the full international number without + or 00 (for example 4930123456789). For a specific route, put the route prefix in front — see route prefixes explained.
Set a real number in international format. Free text such as letters or random strings is passed as-is and many carriers reject or replace it. See how to change caller ID.
outbound_auth missing on the endpoint.direct_media=no and check NAT (external_media_address, external_signaling_address).pjsip show registrations.Need help? Open a ticket from your portal.
Create an account to browse the full A-Z deck in your portal — Premium CLI and Standard clearly labelled, searchable by prefix or destination.