Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Asterisk and FreePBX - Build a PBX with SIP Trunks
New
Rating: 4.7 out of 5(23 ratings)
132 students

Asterisk and FreePBX - Build a PBX with SIP Trunks

Install Asterisk 20 and FreePBX 17, build a dialplan, connect SIP trunks and secure the PBX in 36 real labs
Last updated 10/2026
English
English [Auto],

What you'll learn

  • Read SIP and RTP traffic with packet captures and explain a call from registration to hang-up.
  • Install Asterisk 20 on Ubuntu 24.04 and work with its command line, files, logs and modules.
  • Configure PJSIP endpoints, transports and templates and register softphones.
  • Build a dialplan with patterns, ring groups, voicemail, an IVR menu, time conditions, queues and conferences.
  • Connect the PBX to a SIP provider with a registered trunk and an IP trunk, with inbound and outbound routes.
  • Secure the PBX with strong secrets, access lists, fail2ban, TLS and SRTP.
  • Use the AMI and ARI interfaces, call recording and call records, and check codecs and transcoding.
  • Install FreePBX 17 and set up extensions, trunks, routes, a voice menu, ring groups and queues in the web interface.
  • Asterisk and FreePBX: Build a PBX with SIP Trunks
  • Asterisk PBX and FreePBX Hands-On: SIP Trunk Labs
  • Asterisk, PJSIP and FreePBX for Beginners: SIP Trunks
  • Hands-On Asterisk and FreePBX: Dialplan, Trunks, Security

Course content

1 section • 32 lectures • 1h 58m total length
  • L01_welcome_and_course_map2:49
  • L02_prepare_the_lab6:17
  • L03_sip_and_rtp_basics3:53
  • L04_install_asterisk_20_on_ubuntu_24_043:35
  • L05_cli_files_logs_and_modules3:33
  • L06_pjsip_objects_and_templates3:56
  • L07_register_two_softphones3:53
  • L08_transports_udp_tcp_and_nat_settings4:00
  • L09_extensions_conf_contexts_and_patterns3:53
  • L10_variables_gotoif_gosub_and_saydigits3:45
  • L11_dial_ring_groups_and_fallback4:17
  • L12_voicemail3:44
  • L13_an_ivr_menu3:35
  • L14_time_conditions3:39
  • L15_queues3:40
  • L16_conferences_with_confbridge3:37
  • L17_the_asterisk_manager_interface_ami3:42
  • L18_ari_rest_basics3:36
  • L19_call_recording_and_cdr3:26
  • L20_codecs_and_transcoding3:45
  • L21_provider_setup_second_asterisk3:49
  • L22_register_trunk_and_outbound_route3:39
  • L23_inbound_route_and_did3:25
  • L24_ip_trunk_no_registration3:44
  • L25_caller_id_pai_trust_id3:38
  • L26_strong_secrets_and_acl3:50
  • L27_fail2ban_for_asterisk3:30
  • L28_tls_and_srtp3:57
  • L29_freepbx_17_install_first_login_extensions3:53
  • L30_freepbx_trunks_and_routes_in_the_gui4:03
  • L31_freepbx_voice_menu_groups_queues_and_outro4:11
  • Asterisk and FreePBX - Build a PBX with SIP Trunks0:02

Requirements

  • No telephony experience is needed. You should be able to use a Linux terminal, edit a text file and follow a command on the screen; every other idea is explained first and then practiced. You need five small machines: four Ubuntu 24.04 servers (the PBX, a second Asterisk that plays the SIP provider, and two softphone clients) and one Debian 12 server for FreePBX, as cloud servers with any provider (we used UpCloud) or as virtual machines in VirtualBox, VMware or KVM. Together they need about 7 CPU cores and 14 GB of memory, and you start the FreePBX machine only for the last lectures. The course files include a setup guide with the build steps for the five hosts. The labs cost only a few euros in total with a cloud provider if you delete the servers when you finish. Use lab machines only, never a production phone system.

Description


This course contains the use of artificial intelligence.

A phone system looks complicated until you build one. This course teaches the Asterisk PBX and FreePBX with a simple method: a short explanation with a diagram, and then a real lab. You install Asterisk 20 on Ubuntu 24.04, register two softphones, write the dialplan, and then connect the PBX to a SIP provider with a trunk, in both directions.

Every lab ran for real on cloud servers at UpCloud: a PBX with Asterisk 20.6 from the Ubuntu repository, a second Asterisk that plays the SIP provider, two clients with baresip softphones, and a Debian 12 server with FreePBX 17. You see the real commands and the real results.

You will learn: SIP and RTP basics with packet captures; installing Asterisk and using its command line, files and logs; PJSIP endpoints, transports and templates; the dialplan with patterns, variables, ring groups, voicemail, an IVR menu, time conditions, queues and conferences; the manager interface (AMI) and the REST interface (ARI); call recording and call records; codecs and transcoding; SIP trunks with registration and by IP address, inbound routes with a DID, outbound routes and caller ID; strong secrets, access lists, fail2ban, TLS and SRTP; and FreePBX 17 with extensions, trunks, routes, a voice menu, ring groups and queues in the web interface. Five Extra lectures cover an ARI application in Python, WebRTC and Opus on the server, monitoring with Prometheus, a load test with SIPp, and FreePBX backup and restore.

The course has 31 main lectures with about 1 hour 58 minutes of video, plus 5 Extra lectures of about 18 minutes, as delivered. The course includes a lab guide, command files and expected results for every lab video, plus a setup guide for the five lab hosts; every command and every result is also on the screen, and nothing is paywalled inside the course. The narration voice is AI generated.

Please know before you buy: you need five lab machines, either cloud servers or local virtual machines. There is no real audio in the labs: calls are proven by call records, logs, packet captures and recordings made from a test tone. The softphone baresip cannot negotiate the g722 and opus codecs, so these are shown on concept slides and in server checks only. WebRTC with a real browser was not tested; the Extra lecture shows the server side only. The time condition lab was tested only in part for the closed branch, and the FreePBX firewall page is shown but not switched on. The Asterisk source build is a slide only. Anything not tested live is said plainly in the videos. This is not a certification course and it does not promise a certificate. The lectures are video only, and the course includes a lab guide, command files and expected results for every lab video; every command and every result is also on the screen, and nothing is paywalled inside the course. The narration voice is AI generated.

The course is written for beginners: system administrators and IT support staff who want to run a PBX, people who want to understand SIP trunks, and students who want a practical start in open-source telephony.

This course contains the use of artificial intelligence.

Curriculum Outline

  1. Welcome and course map

  2. Prepare the lab

  3. SIP and RTP basics

  4. Install Asterisk 20 on Ubuntu 24.04

  5. CLI, files, logs and modules

  6. PJSIP objects and templates

  7. Register two softphones

  8. Transports UDP, TCP and NAT settings

  9. extensions.conf: contexts and patterns

  10. Variables, GotoIf, Gosub and SayDigits

  11. Dial, ring groups and fallback

  12. Voicemail

  13. An IVR menu

  14. Time conditions

  15. Queues

  16. Conferences with ConfBridge

  17. The Asterisk Manager Interface (AMI)

  18. ARI REST basics

  19. Call recording and CDR

  20. Codecs and transcoding

  21. Provider setup (second Asterisk)

  22. Register trunk and outbound route

  23. Inbound route and DID

  24. IP trunk (no registration)

  25. Caller ID, PAI, trust_id

  26. Strong secrets and ACL

  27. fail2ban for Asterisk

  28. TLS and SRTP

  29. FreePBX 17: install, first login, extensions

  30. FreePBX trunks and routes in the GUI

  31. FreePBX voice menu, groups, queues and outro

  32. ARI Stasis application (Python)

  33. WebRTC and Opus on the server

  34. Monitoring with Prometheus metrics

  35. Load test with SIPp

  36. FreePBX backup and restore with fwconsole


Who this course is for:

  • Beginners who want to learn the Asterisk PBX by building one
  • System administrators and IT support staff who need to run or connect a phone system
  • People who want to understand SIP trunks and provider setup
  • Students who want a practical start in open-source telephony and VoIP