text
stringlengths
0
152
Now we should have the errors we want, so we’re going to search for them in the sys‐
tem log.
70
|
Chapter 5: User Device Configuration
$ sudo grep -i sealert /var/log/messages |egrep "cert|crt"
You’ll see some messages that look similar to this (we’ve trimmed them for brevity):
SELinux is preventing ... on the file /home/asterisk/certs/self-signed.crt.
For complete SELinux messages run: sealert -l 1dbe51e2-7321-41d3-a5bb-f8f1b4a6f787
SELinux is preventing ... on the directory certs.
For complete SELinux messages run: sealert -l 879db542-e0a9-43e8-8763-62fcf068bfee
SELinux is preventing ... on the file self-signed.crt.
For complete SELinux messages run: sealert -l 8fb85940-ee82-44bd-adcb-e30d31ee516a
What’s useful is that SELinux is telling you exactly what you need to do to solve the
problem!
For each of the three messages relating to access to the certs we just configured, run
the associated command. We’ll just do one to show you what we mean, but you may
need to run more than one until it loads clean.
$ sealert -l 8fb85940-ee82-44bd-adcb-e30d31ee516a
You’re going to get something like this:
SELinux is preventing asterisk from read access on the file self-signed.crt.
***** Plugin catchall (100. confidence) suggests **************************
You can generate a local policy module to allow this access.
allow this access for now by executing:
# ausearch -c 'asterisk' --raw | audit2allow -M my-asterisk
# semodule -i my-asterisk.pp
You’re not root, but you’ll run both the commands it specifies:
$ sudo ausearch -c 'asterisk' --raw | audit2allow -M my-asterisk
$ sudo semodule -i my-asterisk.pp
Remember how everybody is telling you to just disable SELinux? Well, you don’t have
to do that anymore.
OK, restart Asterisk ($ sudo service asterisk restart) and make sure your log‐
file isn’t generating SELinux errors (ignore the .odbc.ini errors as they don’t relate
to /etc/odbc.ini, and shouldn’t affect anything).
You should see that transport-tls is now ready to use:
*CLI> pjsip show transports
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress....................>
==========================================================================================
Transport: transport-tls tls 0 0 0.0.0.0:5061
Transport: transport-udp udp 0 0 0.0.0.0:5060
If you find it’s still not loading, go back and work the SELinux errors in the /var/log/
messages file. Sometimes more than one has to be dealt with.
Configuring Asterisk
|
71
Testing to Ensure Your Devices Have Registered
Once your devices have registered to Asterisk, you will be able to query the location
and state of them from the Asterisk CLI.
It is a common misconception that registration is how a device
authenticates itself for the purpose of obtaining permission to
make calls. This is incorrect. The only purpose of registration is to
allow a device to identify its location on the network, so that Aster‐
isk8 knows where to send calls intended for that device.
Authentication for outgoing calls is an entirely separate process
and always happens on a per-call basis, regardless of whether a set
has registered. This means that your set may be able to make calls,
but not receive them. The most common cause of this is a firewall
that has closed the incoming port (and the solution is to set a regis‐
tration timer that’s low enough that it will re-register every few
minutes, so that the firewall will keep the relevant SIP port open).
It is possible to have a set register successfully, and yet still not be
allowed to make calls. Point being, just because it’s registered
doesn’t mean it can make calls (although this will almost always be
the case).
Verifying the registration of a set is the simplest way to verify that you have config‐
ured it correctly.
Remember that configuration of the set does not happen in Aster‐
isk. You have to configure the device using whatever tools the man‐
ufacturer has provided.