text
stringlengths
0
152
unnecessary.
$ sudo dnf -y install setools setroubleshoot setroubleshoot-server
$ sudo vim /etc/selinux/config
You’re going to change the line SELINUX=enforcing to SELINUX=permissive. This
will ensure the logfiles show potential SELinux errors, without actually blocking the
relevant processes.
Next, we’re going to give Asterisk ownership of the /etc/odbc.ini file.
$ sudo chown asterisk:asterisk /etc/odbc.ini
$ sudo semanage fcontext -a -t asterisk_etc_t /etc/odbc.ini
Asterisk Installation
|
41
$ sudo restorecon -v /etc/odbc.ini
$ sudo ls -Z /etc/odbc.ini
If all is well, you should see now that the file context for this file has been set to aster
isk_etc_t:
-rw-r--r--. asterisk asterisk system_u:object_r:asterisk_etc_t:s0 /etc/odbc.ini
There are a few more SELinux errors we’ve seen here during the writing of the book.
They may have been corrected by the time you read this, but there should be no harm
in running them:
$ sudo /sbin/restorecon -vr /var/lib/asterisk/*
$ sudo /sbin/restorecon -vr /etc/asterisk*
Reboot the system, and we’re going to check the log for any nasty SELinux errors
before we set it to enforcing.
$ sudo grep -i sealert /var/log/messages
There may be a few messages in there complaining about things Asterisk doesn’t need
(for example, a hidden file named .odbc.ini), but so long as it’s not full of errors about
all sorts of important Asterisk components, you should be good to go. One last thing
you have to change is an SELinux Boolean to allow Asterisk to create a TTY.
$ sudo setsebool -P daemons_use_tty 1
Edit the /etc/selinux/config file again, this time setting SELINUX=enforcing. Save and
reboot once more.
Verify that Asterisk is running (as user asterisk).
$ ps -ef | grep asterisk
asterisk 3992 3985 0 16:38 ? 00:00:01 /usr/sbin/asterisk -f -vvvg -c
OK, we’re nearly done with the installation now.
Firewall Tweaks
We’ll make a couple of firewall tweaks to prepare our system for SIP (and SIP Secure).
$ sudo firewall-cmd --zone=public --add-service=sip --permanent
$ sudo firewall-cmd --zone=public --add-service=sips --permanent
Final Tweaks
Your Asterisk system is ready to roll.
Let’s put some initial data into the configuration files, so that in the next chapter we
can begin to work with our new Asterisk system.
42
|
Chapter 3: Installing Asterisk
Since we’re going to use the PJSIP channel for all of our calling, we’re going to tell
Asterisk to look for PJSIP configuration in the database:
$ sudo -u asterisk vim /etc/asterisk/sorcery.conf
[res_pjsip] ; Realtime PJSIP configuration wizard
; eventually more modules will use sorcery to connect to the
; database, but currently only PJSIP uses this
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors
domain_alias=realtime,ps_domain_aliases
contact=realtime,ps_contacts