A complete step-by-step guide to compiling and installing Asterisk PBX from source on Debian 13 Trixie. Configure your system for production use with IPComms SIP trunking.
Before installing Asterisk on Debian 13 (Trixie), ensure your system meets the following requirements. This guide assumes you have root access or sudo privileges.
Download the latest Asterisk LTS version from the official Asterisk downloads page. As of 2026, Asterisk 22 LTS is the recommended version for production systems.
Download and Extract
# Create a source directory
cd /usr/src
# Download Asterisk 22 LTS (latest version)
sudo wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-22-current.tar.gz
# Extract the archive
sudo tar -xvzf asterisk-22-current.tar.gz
# Enter the Asterisk directory
cd asterisk-22*/
Install MP3 Support (Optional)
If you want MP3 playback support for music on hold or prompts:
[general]
rtpstart = 10000
rtpend = 20000
rtpchecksums = no
strictrtp = yes
icesupport = no
Start Asterisk
# Enable Asterisk to start on boot
sudo systemctl enable asterisk
# Start Asterisk service
sudo systemctl start asterisk
# Check status
sudo systemctl status asterisk
6. Configuring for IPComms SIP Trunk
Connect your Asterisk system to IPComms SIP trunking for inbound and outbound calling. Replace the placeholder values with your actual IPComms credentials.
[general]
static = yes
writeprotect = no
; Context for calls coming from IPComms
[from-ipcomms]
exten => _X.,1,NoOp(Incoming call from IPComms: ${CALLERID(all)})
same => n,Answer()
same => n,Playback(hello-world)
same => n,Hangup()
; Context for outbound calls via IPComms
[outbound-ipcomms]
exten => _1NXXNXXXXXX,1,NoOp(Outbound call to ${EXTEN})
same => n,Set(CALLERID(num)=YOUR_DID_NUMBER)
same => n,Dial(PJSIP/${EXTEN}@ipcomms-endpoint,60)
same => n,Hangup()
; International calls (E.164 format)
exten => _011.,1,NoOp(International call to ${EXTEN})
same => n,Set(CALLERID(num)=YOUR_DID_NUMBER)
same => n,Dial(PJSIP/${EXTEN}@ipcomms-endpoint,120)
same => n,Hangup()
Get Your IPComms Credentials
Sign up for IPComms SIP trunking to get your trunk credentials, DID numbers, and access to the customer portal with real-time call analytics. Start with a free SIP trunk — only pay for usage and numbers.
# Show PJSIP endpoints
pjsip show endpoints
# Show detailed endpoint info
pjsip show endpoint ipcomms-endpoint
Make a Test Call
# Originate a test call from CLI
channel originate PJSIP/12025551234@ipcomms-endpoint application Playback hello-world
8. Troubleshooting Common Issues
If you encounter issues with your Asterisk installation or IPComms trunk, use these troubleshooting steps to diagnose and resolve problems.
Registration Failures
Symptom
Cause
Solution
401 Unauthorized
Wrong credentials
Verify username/password in pjsip.conf
408 Request Timeout
Firewall blocking
Open UDP 5060 and 10000-20000
503 Service Unavailable
Server issue
Check IPComms status page
No Audio (One-Way or No Audio)
# Check RTP settings and NAT configuration
sudo asterisk -rx "rtp show settings"
# Verify external IP is set correctly
sudo asterisk -rx "pjsip show transport transport-udp"
Common audio issues and solutions:
● Firewall: Ensure RTP ports (10000-20000) are open for UDP traffic
● NAT: Verify external_media_address is set to your public IP
● direct_media: Must be set to "no" for NAT environments
Enable Debug Logging
# Enable PJSIP debug logging in Asterisk CLI
pjsip set logger on
# View SIP messages in real-time
core set verbose 5
core set debug 5