text
stringlengths
0
152
$ echo "select 1" | isql -v asterisk asterisk password
You should see a result something like this:
+---------------------------------------+
| Connected! |
| sql-statement |
| help [tablename] |
| quit |
+---------------------------------------+
34
|
Chapter 3: Installing Asterisk
SQL> select 1
+---------------------+
| 1 |
+---------------------+
| 1 |
+---------------------+
SQLRowCount returns 1
1 rows fetched
If you do not see the Connected! message, you need to troubleshoot your database
and ODBC installation. The first thing you should do is make sure you can log into
the database from the command line using the asterisk user (mysql -u asterisk
-p). Most ODBC problems tend to end up being credentials problems (i.e., wrong
password or username), so work backward to ensure all the credentials work as they
should, and double-check that you didn’t get any problem messages from Ansible.
As of this writing, the version of jansson installed from the EPEL repo is an older ver‐
sion than the one Asterisk requires, so we’ll have to install that manually.
The system is now prepared, and we’re ready to download and install Asterisk.
Asterisk Installation
Asterisk is officially delivered in a tarball (as source code), and it must be downloa‐
ded, extracted, and compiled.7 This is not difficult to do, so long as you have all the
dependencies correct. Between the writing of this book and your reading of it, there
may have been some changes to the various dependencies, so your install process may
have to be run slightly differently. It’s often difficult to know the difference between
an error message that can safely be ignored, and one that is indicating a critical prob‐
lem; however, in general, you should have identified and resolved any errors in the
previous processes before arriving at this step. If your dependencies are sorted, the
Asterisk install will tend to go smoothly.
Download and Prerequisites
Log out of the system, and log back in as user astmin.8
Type the following commands from the shell in order to download the Asterisk
source code:
7 Note that members of the community will also produce packaged versions of Asterisk. The EPEL repository,
for example, maintains a version that can be installed using dnf (yum). As of this writing, only the tarball ver‐
sion is officially maintained, and we recommend this method at this time, mostly due to the many different
modules that come with Asterisk, and the usefulness in being able to build what you need from source.
8 On a DigitalOcean instance, you’ll need to ensure your SSH key is in the file /home/astmin/.ssh/author‐
ized_keys.
Asterisk Installation
|
35
When you see us write <TAB> in a filename, what we mean is that
you should press the Tab key on your keyboard and allow auto‐
complete to fill in what it can. The rest of the typing then follows.
$ mkdir ~/src
$ cd ~/src
$ wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
$ tar zxvf asterisk-16-current.tar.gz
$ cd asterisk-16.<TAB> # tab should auto-complete (unless it has more than one match)
We can now run a few prerequisites that the Asterisk team has defined, and also have
the environment checked:
$ cd contrib/scripts (or cd ~/src/asterisk-16.<TAB>/contrib/scripts
$ sudo ./install_prereq install # asterisk has a few prerequisites that this simplifies
$ cd ../..
$ ./configure --with-jansson-bundled
Asterisk is now ready to compile and install, but there are a few tweaks worth making
to the configuration before compilation.
Compiling and Installing
$ make menuselect
You will see a menu that presents various options you can select for the compiler. Use
the arrow and Tab keys to move around, and the Enter key to select/deselect. For the
most part, the defaults should be fine, but we want to make a few tweaks to the sound
files in order to ensure we have all the sounds we want, in the best format.