![]() |
How to Set Up an Asterisk VoIP Server on Linux - Wersja do druku +- Indeks forum Nasze Pasieki (https://naszepasieki.org/forum) +-- Dział: Forum Administracyjne (https://naszepasieki.org/forum/forumdisplay.php?fid=3) +--- Dział: Admin ukryte (https://naszepasieki.org/forum/forumdisplay.php?fid=4) +---- Dział: Systemy Operacyjne (https://naszepasieki.org/forum/forumdisplay.php?fid=67) +----- Dział: Linux (https://naszepasieki.org/forum/forumdisplay.php?fid=71) +------ Dział: VoIP - (https://naszepasieki.org/forum/forumdisplay.php?fid=147) +------- Dział: Asterisk (https://naszepasieki.org/forum/forumdisplay.php?fid=148) +------- Wątek: How to Set Up an Asterisk VoIP Server on Linux (/showthread.php?tid=414) |
How to Set Up an Asterisk VoIP Server on Linux - matt - 02-20-2025 How to Set Up an Asterisk VoIP Server on Linux - Server Solutions Setting up a VoIP (Voice over Internet Protocol) server can significantly improve communication efficiency for businesses or individuals. Asterisk is one of the most popular open-source frameworks for building communications applications. In this guide, we’ll walk through the process of setting up an Asterisk VoIP server on a Linux-based system. By the end, you’ll have a fully functional VoIP server that you can customize to meet your needs. Prerequisites Before you start, ensure you have the following: Linux Server: A server running a Linux distribution such as Ubuntu, CentOS, or Debian. This guide will focus on Ubuntu for its popularity and user-friendliness. Root Access: You need root or sudo access to install the necessary packages. Basic Knowledge: Familiarity with the Linux command line and basic networking concepts will be beneficial. Step 1: Update Your System First, it’s crucial to ensure your server is up to date. Open your terminal and run the following commands: Kod PHP: sudo apt update This updates the package list and installs the latest available versions of your installed packages. Step 2: Install Required Dependencies Asterisk requires several packages to function correctly. Install them using: Kod PHP: sudo apt install -y build-essential git wget libxml2-dev libncurses5-dev libssl-dev libnewt-dev libsqlite3-dev These packages provide the necessary tools and libraries for compiling Asterisk from source. Step 3: Download Asterisk Next, you need to download the latest version of Asterisk. At the time of writing, the latest version is 20.10. You can check the official Asterisk website for the most current version. Tutaj dostepne wszytskie wersje jakie sa do pobrania - https://downloads.asterisk.org/pub/telephony/asterisk/ Kod PHP: cd /usr/src After downloading, extract the tarball: Kod PHP: sudo tar -xvf asterisk-20.10.tar.gz Download the mp3 decoder library into the source tree by running below commands: Kod PHP: $ sudo contrib/scripts/get_mp3_source.sh Confirm all dependencies are installed using install_prereq script. Kod PHP: sudo contrib/scripts/install_prereq install Message output from successful installation: Cytat:..... Step 4: Compile and Install Asterisk Now, you can compile and install Asterisk. Start by running the configuration script: Kod PHP: sudo ./configure After the configuration is complete, you will need to run the following commands to build and install Asterisk: Kod PHP: sudo make menuselect Use the arrow keys in your keyboard to navigate through the menus, and Enter key to select. Example selecting Add-ons to install in Asterisk: ![]() Example on adding extra Core Sound Packages to build. ![]() For Music On Hold, select the following minimal modules ![]() On Extra Sound Packages select as shown below: ![]() Enable app_macro under Applications menu. ![]() Feel free to enable or disable any modules as you see fit. After all the configurations, use the “Save and Exit” button to update. To build Asterisk 18 LTS on Debian Linux by running the command below: Kod PHP: sudo make Once the installation is complete, you should also install the sample configuration files: Kod PHP: sudo make config Finally, load the Asterisk service into systemd: Kod PHP: sudo systemctl start asterisk Step 5: Configure Asterisk After installation, Asterisk’s configuration files will be located in the /etc/asterisk directory. The most critical file is sip.conf, where you will define your SIP (Session Initiation Protocol) settings Open sip.conf: Kod PHP: sudo nano /etc/asterisk/sip.conf Add the following lines to set up a basic configuration: Kod PHP: [general] Next, you need to configure your extensions. Open the extensions.conf file: Kod PHP: sudo nano /etc/asterisk/extensions.conf Add a simple extension configuration: Kod PHP: [default] This example allows users with extensions 100 and 101 to call each other. Step 6: Create SIP User Accounts You need to create user accounts for your VoIP clients. Open sip.conf again and add the following entries: Kod PHP: [100] Step 7: Start Asterisk CLI To interact with your Asterisk server, you can use the Asterisk Command Line Interface (CLI). Run the following command: Kod PHP: sudo asterisk -rvv This command connects you to the Asterisk CLI, where you can monitor logs and manage the server in real-time. Step 8: Test Your Configuration You can test your VoIP server by using a softphone client such as Zoiper or Linphone. Configure the softphone with the following details: SIP Server: Your server’s IP address Username: 100 or 101 (as per your configuration) Password: The corresponding password you set in sip.conf Once configured, try making a call between the two extensions. Step 9: Enable Firewall Settings Ensure your firewall settings allow traffic on the necessary ports. You typically need to open ports 5060 (SIP) and 10000-20000 (RTP). For UFW, run: Kod PHP: sudo ufw allow 5060/udp RE: How to Set Up an Asterisk VoIP Server on Linux - matt - 02-20-2025 1-wszy blad podczas instalacji servera: configure: error: *** Please install the 'libedit' development package. lekarstwo - Kod PHP: sudo apt-get -y install libedit-dev 2-gi blad servera: configure: error: *** uuid support not found (this typically means the uuid development package is missing)# lekarstwo : Kod PHP: sudo apt install uuid-dev 3-ci blad podczas instalacji Install libjansson-dev lekarstwo: Kod PHP: sudo apt-get -y install libjansson-dev Kod PHP: sudo ./configure Jezeli wszystko zostanie sprawdzone tona koncu powinnienes ijrzec taki wpis: configure: Menuselect build configuration successfully completed .$$$$$$$$$$$$$$$=.. .$7$7.. .7$$7:. .$$:. ,$7.7 .$7. 7$$$$ .$$77 ..$$. $$$$$ .$$$7 ..7$ .?. $$$$$ .?. 7$$$. $.$. .$$$7. $$$$7 .7$$$. .$$$. .777. .$$$$$$77$$$77$$$$$7. $$$, $$$~ .7$$$$$$$$$$$$$7. .$$$. .$$7 .7$$$$$$$7: ?$$$. $$$ ?7$$$$$$$$$$I .$$$7 $$$ .7$$$$$$$$$$$$$$$$ :$$$. $$$ $$$$$$7$$$$$$$$$$$$ .$$$. $$$ $$$ 7$$$7 .$$$ .$$$. $$$$ $$$$7 .$$$. 7$$$7 7$$$$ 7$$$ $$$$$ $$$ $$$$7. $$ $$$$$$$. .7$$$$$$ $$ $$$$$$$$$$$$7$$$$$$$$$.$$$$$$ $$$$$$$$$$$$$$$$. No wiec mamy server - to teraz pytanie jak to wszystko zaimplementowac do sieci LAN na poczatek tak aby to dzialalo - nie mam pojecia czy jest potrzebny jakis client >? - To droga ktora musze sam przejsc i opracowac to samemu z pomoca wojka GOOGLE ![]() RE: How to Set Up an Asterisk VoIP Server on Linux - matt - 02-20-2025 centos ustawienia : https://mike42.me/blog/2015-01-02-how-to-set-up-asterisk-in-10-minutes RE: How to Set Up an Asterisk VoIP Server on Linux - matt - 02-20-2025 DEBIAN Konfiguracja https://computingforgeeks.com/install-asterisk-lts-on-debian-linux/ - Dokumentacja znajduje sie tu - https://github.com/asterisk/documentation zreszta na stronie https://www.asterisk.org mozna wyszukac instalacje oraz konfiguracje Tu zajebiscie wytlumaczone i pokazane jak i co Asterisk VOIP Server Setup On Ubuntu 20 | Making Calls via SIP Soft Phone | Rocket System RE: How to Set Up an Asterisk VoIP Server on Linux - matt - 02-21-2025 sip.conf below: Kod PHP: [general] extensions.conf below: Kod PHP: [internal] voicemail.conf below: Kod PHP: [main] ---------------------------- [general] context=internal allowguest=no allowoverlap=no bindport=5060 bindaddr=0.0.0.0 srvlookup=no disallow=all allow=ulaw alwaysauthreject=yes canreinvite=no nat=yes session-timers=refuse localnet=192.168.0.0/255.255.255.0 [7001] type=friend host=dynamic secret=7001 context=internal [7002] type=friend host=dynamic secret=7002 context=internal RE: How to Set Up an Asterisk VoIP Server on Linux - matt - 02-24-2025 Stad tez mozna zainstalowac - https://hotkey404.com/installing-asterisk-20-from-source-on-debian-12/ RE: How to Set Up an Asterisk VoIP Server on Linux - matt - 03-02-2025 Wlaczenie SIP w asterisk W CLI wpisujemy module load chan_sip.so lecz po tym wyskoczy erro ze port nasluchu jest wykozystany wiec trzeba wyedytowac plik plik sip - zamienic istniejacy port 5060 na 5070 dla przyklasu. Po czym raz jeszcze wpisac w CLI module load chan_sip.so a nastepnie przeladowac ustawieni asteriska za pomoca komendu core reload , lubn core restart Później musimy tylko dopisać załadowanie modułu chan_sip.so do modules.conf, żeby sterownik był ładowany podczas autostartu Asteriska. informacja zaczerpnieta z tej ztrony www: https://hotkey404.com/pl/samouczek-asteriska-ladowanie-modulow/ Moduł chan_sip.so Począwszy od Asteriska 13, PJSIP jest domyślnym sterownikiem do obsługi kanałów. Dlatego plik sip.conf nie jest już domyślnie generowany przez make basic-pbx, ale przez make samples już tak. Jeśli posiadasz przykładowe pliki, mogło by się wydawać, że wystarczy skopiować plik sip.conf do /etc/asterisk/ oraz załadować moduł w modules.conf. Jednak jeśli w CLI (polecenie asterisk -r) wykonamy „module load chan_sip.so” otrzymamy błąd: WARNING[1901]: chan_sip.c:33496 reload_config: Failed to bind to 0.0.0.0:5060: Address already in use |