PJSIP configuration on Asterisk
Simtex SIP Trunks from $4.99/month
Business-grade SIP trunking with geo-redundant infrastructure, crystal-clear audio, and Australian-based support. Pay-as-you-go or unlimited plans available.
Overview
This guide walks you through configuring a Simtex SIP trunk using the PJSIP channel driver on a vanilla Asterisk system. PJSIP is the modern replacement for chan_sip and offers improved performance, security, and standards compliance.
The main configuration file you'll be working with is pjsip.conf. You'll also need to update extensions.conf to use the PJSIP channel driver for dialling.
What you'll need
- A working Asterisk installation with PJSIP support
- Your Simtex account number (e.g.
214XXXXXXX) - Your Simtex SIP password
- Your server's public IP address
- West Coast (AU):
siptcp.simtex.com.au - East Coast (AU):
siptcpeast.simtex.com.au
Choose the server closest to your location. Our platform publishes SRV records for automatic failover between geo-redundant server farms.
Step 1 — Transport
First, configure a TCP transport in pjsip.conf. We recommend TCP over UDP for reliability and NAT traversal.
[Transport-TCP]
type = transport
protocol = tcp
bind = 0.0.0.0local_net and external_media_address to your transport configuration.Step 2 — Registration, Authentication & AOR
Next, configure three related objects: a registration to register with Simtex, an auth section for credentials, and an AOR (Address of Record) to define the contact endpoint.
Registration
[Simtex]
type = registration
server_uri = sip:214XXXXXXX@siptcp.simtex.com.au:5062;transport=tcp
client_uri = sip:214XXXXXXX@XXX.XXX.XXX.XXX
contact_user = 214XXXXXXX
transport = Transport-TCP
outbound_auth = Simtex_Auth
auth_rejection_permanent = no
retry_interval = 30
forbidden_retry_interval = 290
max_retries = 20Replace 214XXXXXXX with your Simtex account number and XXX.XXX.XXX.XXX with your server's public IP address.
siptcp.simtex.com.au with siptcpeast.simtex.com.au in the server_uri if your server is located on the East Coast of Australia.Authentication
[Simtex_Auth]
type = auth
username = 214XXXXXXX
password = XXXXXXXXAOR (Address of Record)
[Simtex_Aor]
type = aor
contact = sip:siptcp.simtex.com.au:5062;transport=tcp
qualify_timeout = 4.0
qualify_frequency = 50Step 3 — Endpoint & Identify
Define the endpoint and an identify section so Asterisk knows which endpoint to associate incoming traffic with.
Endpoint
[Simtex_Endpoint]
type = endpoint
context = From_Simtex
disallow = all
allow = alaw
allow = ulaw
outbound_auth = Simtex_Auth
aors = Simtex_Aor
from_user = 214XXXXXXX
send_pai = yes
send_rpid = yes
trust_id_inbound = yes
transport = Transport-TCPIdentify
[Simtex_Identify]
type = identify
endpoint = Simtex_Endpoint
match = siptcp.simtex.com.auThe identify section tells Asterisk to route incoming calls from Simtex to the Simtex_Endpoint.
Step 4 — Extension Configuration
With the trunk configured, you'll need at least one local extension to make and receive calls. Here's a basic PJSIP extension example:
[6001]
type = endpoint
context = default
disallow = all
allow = alaw
allow = ulaw
transport = Transport-TCP
auth = 6001_Auth
aors = 6001_Aors
[6001_Auth]
type = auth
auth_type = userpass
password = Ch@ngeM3!
username = 6001
[6001_Aors]
type = aor
max_contacts = 1
qualify_timeout = 4.0
qualify_frequency = 50Next Steps
With your trunk registered and an extension configured, you can now set up your dialplan in extensions.conf to route calls through the Simtex trunk.
Note that the PJSIP dial syntax differs from the legacy chan_sip driver. For detailed examples of dialling patterns, caller ID management, and other PJSIP-specific tips, see our companion article: