diff --git a/manuals/README.md b/manuals/README.md index 9166405..a883199 100644 --- a/manuals/README.md +++ b/manuals/README.md @@ -1,5 +1,6 @@ # Мануалы ## [Asterisk](src/asterisk.md) +## [Установка Asterisk](src/asterisk-install.md) ## [initrd (Initial RAM Disk)](src/initrd.md) ## [Базовая настройка подключения к серверу Samba](src/samba.md) diff --git a/manuals/src/asterisk-install.md b/manuals/src/asterisk-install.md new file mode 100644 index 0000000..dafc3ff --- /dev/null +++ b/manuals/src/asterisk-install.md @@ -0,0 +1,130 @@ +# Установка Asterisk + +## Установка в Alpine Linux + +### Начальные настройки + +Содержание `/etc/resolv.conf`: + +``` +nameserver 10.100.10.10 +``` + +Содержание `/etc/network/interfaces`: + +``` +auto eth0 +iface eth0 inet static + address 192.168.101.116 + netmask 255.255.254.0 + gateway 192.168.100.1 +``` + +Перезагрузка сервиса: + +``` +/etc/init.d/networking restart +``` + +При установке создать пользователя `astmin`. + +### Установка СУБД + +```sh +apk add mariadb mariadb-client +/etc/init.d/mariadb setup +service mariadb start +``` + +Вход в `CLI` и выполнение SQL-запросов: + +``` +mysql +CREATE DATABASE asterisk; +CREATE USER 'asterisk'@'localhost' IDENTIFIED BY 'asterisk'; +GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'localhost'; +FLUSH PRIVILEGES; +``` + +### `ODBC` драйвер + +Раскомменитровать репозитории `community`, `testing` в `/etc/network/interfaces`: + +``` +#/media/cdrom/apks +http://alpine.bardia.tech/v3.16/main +#http://alpine.bardia.tech/v3.16/commu +#http://alpine.bardia.tech/edge/main +http://alpine.bardia.tech/edge/communi +http://alpine.bardia.tech/edge/testing +``` + +Обновить список репозиторий: + +```sh +apk update +``` + +Установить `ODBC` драйвера: + +```sh +apk add unixodbc mariadb-connector-odbc +``` + +Содержимое `/etc/odbcinst.ini`: + +``` +[MariaDB] +Description = MariaDB Connector/ODBC v.3.0 +Driver64 = /usr/lib/mariadb/libmaodbc.so +``` + +Содержимое `/etc/odbc.in`: + +``` +[asterisk] +Driver = MariaDB +Description = MariaDB connection to 'asterisk' database +Server = localhost +Port = 3306 +Database = asterisk +UserName = asterisk +Password = asterisk +Socket = /var/run/mysqld/mysqld.sock +#Socket = /var/lib/mysql/mysql.sock +``` + +Проверка связи: + +``` +~# echo "select 1" | isql -v asterisk asterisk asterisk ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| echo [string] | +| quit | +| | ++---------------------------------------+ +SQL> select 1 ++------------+ +| 1 | ++------------+ +| 1 | ++------------+ +SQLRowCount returns 1 +1 rows fetched +``` + +### Выставление необходимых прав + +Добавить пользователя в группы `asterisk` и `wheel` в `/etc/group`: + +``` +astmin:x:1000:asterisk,wheel +``` + +``` +chown asterisk:asterisk /etc/asterisk ; sudo chmod 664 /etc/asterisk +```