asterisk/README.md

70 lines
2.1 KiB
Markdown

# asterisk
## Installing Dependencies
Before installing Asterisk, you need to update your package lists and install the necessary dependencies. Open your terminal and execute the following commands:
`sudo apt update`
`sudo apt upgrade`
`sudo apt install -y wget build-essential subversion`
## Downloading and Installing Asterisk
With the dependencies in place, you can now download and compile Asterisk:
`cd /usr/src`
`sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz`
`sudo tar xvf asterisk-18-current.tar.gz`
Change into the extracted directory and install additional required packages:
`cd asterisk-18*`
`sudo contrib/scripts/install_prereq install`
Now, proceed to compile and install Asterisk:
`sudo ./configure`
`sudo make menuselect`
`sudo make`
`sudo make install`
`sudo make samples`
`sudo make config`
`sudo ldconfig`
With Asterisk installed, you can now set up its user and group permissions:
`sudo adduser --system --group --no-create-home asterisk`
`sudo chown -R asterisk:asterisk /etc/asterisk`
`sudo chown -R asterisk:asterisk /var/{lib,log,spool}/asterisk`
`sudo chown -R asterisk:asterisk /usr/lib/asterisk`
## Configuring Asterisk
Editing the main configuration file is the next step. Open it using your favorite text editor:
`sudo vim /etc/asterisk/asterisk.conf`
Make the necessary changes according to your setup, then start and enable Asterisk at boot:
`sudo systemctl start asterisk`
`sudo systemctl enable asterisk`
Ensure that Asterisk is running without issues:
`sudo asterisk -vvvr`
## Setting Up PJSIP Accounts
To handle VoIP calls, you need to set up PJSIP accounts. Edit the pjsip.conf and extensions.conf files:
`sudo vim /etc/asterisk/pjsip.conf`
`sudo vim /etc/asterisk/extensions.conf`
Add your SIP users in pjsip.conf and dial plan in extensions.conf.
## Google TTS script for Asterisk
You'll need to install the following dependencies:
`sudo apt install perl libwww-perl liblwp-protocol-https-perl sox mpg123`
Then download the script from the Google TTS repository and place it in the appropriate directory:
https://github.com/zaf/asterisk-googletts