text
stringlengths
0
152
sqlalchemy.url = mysql://user:pass@localhost/asterisk
# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic
Make a copy of it, comment it out, and edit it with the correct credentials:
#sqlalchemy.url = postgresql://user:pass@localhost/asterisk
#sqlalchemy.url = mysql://user:pass@localhost/asterisk
sqlalchemy.url = mysql://asterisk:YouNeedAReallyGoodPasswordHereToo@localhost/asterisk
# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic
Now, with that very simple bit of configuration, we can use Alembic to automagically
configure the database perfectly for Asterisk (this used to be somewhat painful to do
in past versions of Asterisk):
$ alembic -c ./config.ini upgrade head
Alembic is not used by Asterisk, so the configuration you’ve just
performed does not allow Asterisk to use the database. All it does is
run a script that creates the schema and tables Asterisk will use
(you could do this manually as well, but trust us, you want Alembic
to handle this). It’s part of the install/upgrade process. It’s especially
useful if you have live tables, with real data in them, and want to be
able to upgrade and retain the relevant configuration.
Log into the database now, and review all the tables that have been created:
$ mysql -u asterisk -p
mysql> use asterisk;
mysql> show tables;
You should see a list similar to this:
| alembic_version_config |
| extensions |
| iaxfriends |
| meetme |
| musiconhold |
| ps_aors |
| ps_asterisk_publications |
| ps_auths |
| ps_contacts |
| ps_domain_aliases |
| ps_endpoint_id_ips |
| ps_endpoints |
| ps_globals |
| ps_inbound_publications |
| ps_outbound_publishes |
40
|
Chapter 3: Installing Asterisk
| ps_registrations |
| ps_resource_list |
| ps_subscription_persistence |
| ps_systems |
| ps_transports |
| queue_members |
| queue_rules |
| queues |
| sippeers |
| voicemail |
We’re not going to configure anything in the database as of yet. We’ve got some more
base configuration to do first.
Exit the database CLI.
Now that we’ve got the database structure to handle Asterisk config, we’re going to
tell Asterisk how to connect to the database.
$ sudo -u asterisk vim /etc/asterisk/res_odbc.conf
Once again, you’ll need the credentials you defined in your Ansible playbook.
[asterisk]
enabled => yes
dsn => asterisk
username => asterisk
password => YouNeedAReallyGoodPasswordHereToo
pre-connect => yes
SELinux Tweaks
We’re going to install some SELinux tools, and make a few changes to the SELinux
configuration so that the system will boot properly.
A common approach is to simply edit /etc/selinux/config, and set
enforcing=disabled. We do not recommend this, but doing so
completely disables SELinux and renders the following steps