Asterisk 22+ Post-Installation Configuration Guide

Published On: January 26, 2026
Follow Us
Installing Asterisk 20 from source on Ubuntu

Post-Installation Configuration Guide This guide assumes:

  • Asterisk 22 LTS is already installed
  • OS: Linux (Ubuntu / Debian / Rocky / Alma / CentOS)
  • You are using PJSIP only (required in 22+)

1️⃣ Directory Structure Overview (Know This First)

Important Asterisk paths:

/etc/asterisk/        → Configuration files
/var/lib/asterisk/    → Sounds, MOH, database
/var/log/asterisk/    → Logs
/var/spool/asterisk/  → Voicemail, queues, recordings
/usr/lib/asterisk/    → Modules

2️⃣ Core Configuration Files (What Each One Does)

FilePurpose
asterisk.confMain system paths & options
modules.confLoad/unload modules
logger.confLogging
pjsip.confSIP endpoints (phones, trunks)
extensions.confDialplan (call logic)
queues.confCall queues
voicemail.confVoicemail
features.confCall features
musiconhold.confMOH
http.confHTTP / REST
rtp.confMedia

3️⃣ asterisk.conf (Core Engine)

📄 /etc/asterisk/asterisk.conf

[directories]
astetcdir => /etc/asterisk
astvarlibdir => /var/lib/asterisk
astlogdir => /var/log/asterisk
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astmoddir => /usr/lib/asterisk/modules

[options]
documentation_language = en_US
verbose = 3
debug = 0

✅ Usually minimal changes needed.


4️⃣ modules.conf (Critical for Asterisk 22)

📄 /etc/asterisk/modules.conf

[modules]
autoload=yes

noload => chan_sip.so
noload => chan_iax2.so

🚫 chan_sip must NOT be loaded (removed in 22).


5️⃣ logger.conf (Logging & Debugging)

📄 /etc/asterisk/logger.conf

[general]
dateformat=%F %T

[logfiles]
console => notice,warning,error
messages => notice,warning,error
security => security
full => debug,verbose,notice,warning,error

📍 Logs live in:

/var/log/asterisk/

6️⃣ pjsip.conf (MOST IMPORTANT FILE)

6.1 Global Settings

[global]
type=global
user_agent=Asterisk22PBX

6.2 Transport (UDP Example)

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

6.3 Endpoint Template (Best Practice)

[endpoint-template]
type=endpoint
context=from-internal
disallow=all
allow=ulaw,alaw
direct_media=no

6.4 Authentication Template

[auth-template]
type=auth
auth_type=userpass

6.5 AOR Template

[aor-template]
type=aor
max_contacts=1
remove_existing=yes

6.6 Create an Extension (Phone 1001)

[1001]
type=endpoint
endpoint_template=endpoint-template
auth=1001-auth
aors=1001-aor

[1001-auth]
type=auth
auth_type=userpass
username=1001
password=StrongPassword123

[1001-aor]
type=aor
max_contacts=1

📞 Register SIP phone using:

  • Username: 1001
  • Password: StrongPassword123
  • Server: PBX IP

7️⃣ extensions.conf (Dialplan – Call Logic)

📄 /etc/asterisk/extensions.conf

7.1 Internal Calls

[from-internal]
exten => _1XXX,1,NoOp(Internal Call)
 same => n,Dial(PJSIP/${EXTEN},20)
 same => n,Voicemail(${EXTEN}@default)
 same => n,Hangup()

7.2 Outbound Calls

exten => _9X.,1,NoOp(Outbound Call)
 same => n,Set(CALLERID(num)=1001)
 same => n,Dial(PJSIP/${EXTEN:1}@siptrunk)
 same => n,Hangup()

8️⃣ voicemail.conf

📄 /etc/asterisk/voicemail.conf

[default]
1001 => 1234,User One,user1@example.com
1002 => 1234,User Two,user2@example.com

Check voicemail:

*97

9️⃣ queues.conf (Call Center Example)

📄 /etc/asterisk/queues.conf

[support]
musicclass=default
strategy=ringall
timeout=15
retry=5
maxlen=10

member => PJSIP/1001
member => PJSIP/1002

Dialplan:

exten => 600,1,Queue(support)

🔟 musiconhold.conf

📄 /etc/asterisk/musiconhold.conf

[default]
mode=files
directory=/var/lib/asterisk/moh

1️⃣1️⃣ rtp.conf (Audio Issues Fix)

📄 /etc/asterisk/rtp.conf

[general]
rtpstart=10000
rtpend=20000

🔥 Open these ports in firewall.


1️⃣2️⃣ http.conf (Optional – APIs)

[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088

Used for:

  • ARI
  • WebRTC
  • REST control

1️⃣3️⃣ Reload & Verify

asterisk -rvvv
core reload
pjsip reload
dialplan reload

Check:

pjsip show endpoints
core show channels

1️⃣4️⃣ Security Checklist (VERY IMPORTANT)

✅ Firewall:

5060/UDP (SIP)
10000-20000/UDP (RTP)

✅ Fail2Ban
✅ Strong SIP passwords
✅ No anonymous calls
✅ Never expose AMI publicly


1️⃣5️⃣ Common Post-Install Tests

TestCommand
SIP Registeredpjsip show endpoints
Calls Activecore show channels
Audiortp set debug on
SIP Debugpjsip set logger on
Logs/var/log/asterisk/full

✅ Final Best Practices

  • Use templates in pjsip.conf
  • Reload instead of restart
  • Backup /etc/asterisk
  • Keep Asterisk updated
  • Document your dialplan

sapan singh

👨‍💻 About Sapan Singh Hi, I’m Sapan Singh — a passionate software developer with a strong love for technology, gaming, and building useful digital tools.

Join WhatsApp

Join Now

Join Telegram

Join Now

Leave a Comment