Install Asterisk 18 from source on CentOS Stream 8

Today we will do a new installation of CentOS Stream 8 and then on top of it, we’ll install the latest Asterisk long-term support version which is Asterisk 18. As usual, if you want to follow along as we type all those commands, you can visit our website hotkey404.com  (and the link is as usual in the description) or you can just download the file that will automatically execute everything from the video.

So if you decide to skip the video and just go to the command you might at least consider subscribing to the channel so that you’ll know when we upload the newest videos regarding Asterisk. So now grab a coffee, sit back, relax and enjoy the video.

Well …

I meant … grab your server and let’s get to work. Okay!

So it’s time to start our net installation of CentOS Stream 8 and I’m not going to cover every detail. Just some basics. So let’s just hit continue. And we have plenty of options. So we will start by setting the ‘root’ password.

At this point, you might want to create an additional user if you want to. Then it’s good to set up a time and date so just click your time zone. Do some network and hostname configuration. And here we will set up our hostname, hit ‘Apply’, do some IPv4 configuration with static IP address, and just turning this ethernet card on. And as you can see it’s connected.

Now we will set up a source for our installation. So it is going to be mirror.centos.org/centos/8-stream/BaseOS/x86_64/os and after that, it will enable additional options.

So we will select ‘Minimal’ installation so that it won’t consume any additional resources of our server and basically we don’t need any additional stuff at this point.

So going back to our main menu, we will do some storage configuration and of course, at this point, you might want to select ‘Custom’ storage configuration. I will just stick to ‘Automatic’ because … well.

We don’t need some specific configuration. So once we have those basics, we can just skip the rest for now and just hit ‘Begin installation’ and wait a few minutes.

So we’ve done network installation and as you can see it’s downloading all the files necessary for our installation.

And I prefer that because actually, it happened … uh well.

Plenty of times … when I’ve seen someone doing a regular DVD or CD and then after connecting the server they found out that there is something wrong with the network setup.

So doing that will allow you to have up-to-date packages and also you will be 100% sure that your configuration is correct. So once we have that, we will just ‘Reboot’ our system and time to jump to Asterisk installation. So we are going to log in as ‘root’ and password that we have set up in the previous step but instead of just continuing here, I’m just going to check the IP address with ‘IP a’ and continue via ssh client, because …

well …

Personally, I think it’s more convenient. So once we’re logged in as ‘root’, once again via putty (in my case) we’ll just continue and we will start with ‘yum -y update’ because I think it’s usually the best thing to start with.

Then we will install some necessary additional packages, so ‘yum -y install nano wget tar ncurses-devel’ Well … it is a bit strange that later we will use this special file that will install all those pre-required packages but it doesn’t install that. So we’ll do this right away.

Next step, we are going to disable our firewall, so when you type ‘sestatus’, it will show you that SELinux is ‘enabled’ and  ‘enforcing’.

So we will do ‘nano /etc/selinux/config’ and instead of ‘enforcing’ we will do ‘disabled’. And at this point you might want to reboot your system so that this additional firewall will be completely disabled or at this point you can just do ‘setenforce 0’ and when you type once again  ‘sestatus’ you will see that it’s still ‘enabled’ but it’s ‘permissive’ so it will not mess with our  Asterisk installation.

Now for some convenience, we can ‘cd /usr/src/’ and here  ‘wget http://downloads.asterisk.

org/pub/telephony/asterisk/asterisk-18-current.tar.gz And it will download our Asterisk and once we have this downloaded we will unpack it with ‘tar -zxvf asterisk-18-current.tar.gz’  and then continue to this directory (‘cd’).

And at this point you might want to consider installing one additional repository and this is well-known EPEL-release, so we will do that and  it will enable this option to have some additional packages. So we will install this with ‘yum -y install epel-release’ And now time to do our main script that will install all required packages. so ‘contrib/scripts/install_prereq install’ and it will take a few minutes and we’ll install all those additional packages that are required for our software to compile correctly. Okay. So at this point it’s time to do some main configure command and  if you’re used to some previous versions, probably you’re thinking about adding like with-jansson-bundled, with-pjproject-bundled, but now it is no longer necessary, because it is automatically added  to our ‘configure’ command.

So we will just define our lib directory so we will do ‘./configure –libdir=/usr/lib64/’. And there is actually no other choice because CentOS Stream  only supports 64-bit operating system. So it’s obvious that we are going to use that.

And after a few seconds probably you will notice an error.

And this is really surprising, because you  expect this previous command to install everything necessary but CentOS Stream (or actually  starting from CentOS 8) this package libedit-devel’ is now a part  of PowerTools repository. So it will not install automatically unless you enable  this repository. So we will just do ‘dnf –enablerepo=powertools install -y libedit-devel’ So as of today (I mean the date of recording this video) this is  the only package that is missing but in the future, if something similar happens you’ll at  least know what to do. Maybe just go to PowerTools and you should find some additional packages there. So once we have that, we will just go back to our configure command and you will have this  ‘.

/configure –libdir=/usr/lib64/’ and this time this ‘configure’ command will end nicely. And with our  Asterisk logo, it’s time to hit ‘make’ four times. So first we will do ‘make menuselect’ and this will open this nice graphic menu and inside you can see a lot of options like applications, bridging modules, channel drivers, codec translations, modules, resources modules, well …

I’m not going to cover everything from this. However, it’s good to maybe scroll through the menu and see if there is something specific that interests you. Then after saving an exit (or in my case just exit) we will hit  ‘make’ for the second time, but this is just going to be ‘make’ and it is going to take a few minutes. So it will finish with building documentation and it will just tell you what to do next: ‘make install’. Well.

This is kind of obvious so let’s do just that. And it will end with this nice  ‘Asterisk installation complete’ box and inside you have few options: to make samples, to make basic-pbx, and I’m not going to cover all those possibilities right now. In our previous video, we have this covered and explained, so I will do exactly the same.

So first I’m going to ‘make samples’ and this will create all those sample files with nice documentation. And then in addition to that we are going to make a directory with ‘mkdir /etc/asterisk/samples’ and we will just move all those sample files there so ‘mv /etc/asterisk/*.* /etc/asterisk/samples/’.

And then, we will just do ‘make basic-pbx’. So now when we hit ‘ls /etc/asterisk/’  we will see all those basic-pbx files and inside ‘ls /etc/asterisk/samples’ we have a lot more with the documentation.

So we can hit ‘make’ for the last time so ‘make config’ and it will add some startup files and link our Asterisk to our config files.

For example, we may now use ‘systemctl start asterisk’ and we can just do ‘asterisk -r’ and as you can see we are inside  and you have (as of today) asterisk 18.3 installed on your server. So that’s it for today. We have installed Asterisk 18 on top of CentOS Stream 8.

So I hope you learned how to do this. So thank you again for watching and see you next time.

As found on YouTube

About aatifriaz

Aatif riaz is a professional writer and SEO professional. He loves to write articles about health and technology.

View all posts by aatifriaz →