Asterisk PJSIP Tips and Tricks
Simtex SIP Trunks from $4.99/month
Geo-redundant SIP trunking with Australian-based support. Pay-as-you-go or unlimited plans.
Multiple Devices per Extension
To ring multiple devices on a single extension, increase max_contacts on the AOR and use PJSIP_DIAL_CONTACTS in your dialplan.
pjsip.conf
[6001_Aors]
type = aor
max_contacts = 2
qualify_frequency = 50extensions.conf
; Old (rings only the last registered device):
exten => _6XXX,1,Dial(PJSIP/${EXTEN})
; New (rings ALL registered devices simultaneously):
exten => _6XXX,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})})PJSIP_DIAL_CONTACTS expands to a comma-separated list of all registered contacts for that endpoint, so every device rings.
Useful CLI Commands
These Asterisk CLI commands are essential for debugging PJSIP trunk and endpoint issues.
Registration & Trunk Status
# Check trunk registration status
asterisk -rx 'pjsip show registrations'
# Show all configured endpoints
asterisk -rx 'pjsip show endpoints'
# Detailed view of a specific endpoint
asterisk -rx 'pjsip show endpoint Simtex_Endpoint'
# Show AOR contact bindings (which devices are registered)
asterisk -rx 'pjsip show aors'
# Check a specific AOR's contacts
asterisk -rx 'pjsip show aor 6001_Aors'Live Debugging
# Watch SIP traffic in real time (signalling only)
asterisk -rx 'pjsip set logger on'
# Turn it off when done (very verbose)
asterisk -rx 'pjsip set logger off'
# Show active channels / calls
asterisk -rx 'core show channels'
# Show active calls with detail
asterisk -rx 'core show calls'
# Reload PJSIP config without restart
asterisk -rx 'pjsip reload'pjsip set logger on is the PJSIP equivalent of sip set debug on from chan_sip. It dumps full SIP message traces to the CLI — invaluable for diagnosing registration failures, one-way audio, or codec negotiation issues. Remember to turn it off when done.Common Troubleshooting
Trunk won't register
# Check registration status and error
asterisk -rx 'pjsip show registrations'
# Look for auth failures in the log
asterisk -rx 'pjsip set logger on'
# Then trigger a re-register:
asterisk -rx 'pjsip send unregister Simtex'
asterisk -rx 'pjsip send register Simtex'Common causes: wrong credentials, firewall blocking outbound SIP, DNS resolution failure.
One-way audio
Usually a NAT issue. Verify your transport config includes:
[Transport-TCP]
type = transport
protocol = tcp
bind = 0.0.0.0
local_net = 192.168.0.0/16
external_media_address = YOUR.PUBLIC.IP
external_signaling_address = YOUR.PUBLIC.IPNo audio at all
# Check RTP port range is open
asterisk -rx 'rtp show settings'
# Verify codec negotiation
asterisk -rx 'pjsip show endpoint Simtex_Endpoint' | grep allowSimtex Portal — Live Endpoint Monitoring
In addition to Asterisk CLI tools, the Simtex Customer Portal provides real-time visibility into your SIP registrations without needing SSH access to your PBX.
Subscriptions Page
Navigate to Subscriptions in the portal to see:
- Endpoint status indicators — green (registered), red (unregistered), grey (unknown) for every SIP endpoint on your account
- Endpoint filtering — search and filter endpoints to quickly find specific devices
- Registration data — view the registered contact URI, user agent, and last registration timestamp
SIP Events Timeline
Click into an endpoint to access the SIP Events Timeline — a chronological view of registration and unregistration events. Useful for:
- Confirming whether a phone has registered recently
- Diagnosing intermittent registration drops
- Verifying failover behaviour after network changes
- Correlating phone issues with network events
Caller ID Tips
Set outbound caller ID per trunk
[Simtex_Endpoint]
type = endpoint
from_user = 214XXXXXXX
send_pai = yes
send_rpid = yes
trust_id_inbound = yesOverride caller ID per call in dialplan
; Set caller ID before dialling out
exten => _0.,1,Set(CALLERID(num)=61894883344)
same => n,Dial(PJSIP/${EXTEN}@Simtex_Endpoint)Related
PJSIP Configuration on Asterisk — full trunk setup guide