# Asterisk VOIP / SIP compilation in Ubuntu Linux 20.04 # Kwynn Buess 2021/08/28 7:01pm EDT # See today's blog entry: https://kwynn.com/t/7/11/blog.html # do NOT run this blindly / run it as a batch unless you review it and know what you're doing. There is one potentially # dangerous command. # space requirement is 1.1 GB # for the first group of commands, you at least need to do "apt update" or else the Asterisk prereq command # won't work because apt / aptitude won't have current servers. Might as well do the rest. They only take a few minutes. # This assumes I'm starting from a new AWS instance. If you've run apt update and upgraded recently enough, there is # no need. sudo timedatectl set-timezone America/New_York sudo apt update sudo apt dist-upgrade sudo reboot # just making sure you're updated sudo apt update # Assumes new AWS instance but not harmful. # confirm which is the AWS local NVME sudo fdisk -l # ********************** # ********************************************** # BE VERY CAREFUL!!!! ***** THE NEXT COMMAND ASSUMES NEW AWS INSTANCE AND *IS* OTHERWISE HARMFUL *** # If you are using anything else, skip these steps until I declare it "end of danger" below. # THIS COMMAND MAY SERIOUSLY MESS UP YOUR LOCAL SYSTEM, SO DO NOT RUN THEM UNLESS YOU KNOW WHAT YOU ARE DOING!!! # !!!!! THIS FORMATS (ERASES) A DISK!!!!!!! sudo mkfs -t ext4 /dev/nvme1n1 # !!!!! BE CAREFUL ABOVE !!!!!! ****** # ************************************************* # end of danger # the following still assumes you're on an AWS instance with local storage, but it shouldn't damage anything elsewhere # with that said, don't run these unless you know it's appropriate in your case mkdir /tmp/nvme sudo mount /dev/nvme1n1 /tmp/nvme cd /tmp/nvme sudo chown ubuntu . # OK # GENERAL COMMANDS FOR ANY SYSTEM - end of assumptions about AWS and such # Do the following wherever you want to download and build Asterisk # You may want to make it a permanent place to have the sample configs and source for reference # but you don't need to keep any of this because the binaries and working configs will be installed elsewhere # You will need 1.1 GB for the following # check for a new Asterisk version after 18.x.y at the parent: # https://downloads.asterisk.org/pub/telephony/asterisk/ wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz gunzip *.gz tar -xvf *.tar # Assumes a specific Asterisk version sudo ./asterisk-18.6.0/contrib/scripts/install_prereq install git clone -b next git://git.asterisk.org/dahdi/linux dahdi-linux cd dahdi-linux make sudo make install cd .. git clone https://github.com/asterisk/dahdi-tools.git cd dahdi-tools autoreconf -i ./configure make sudo make install sudo make install-config cd .. wget https://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz gunzip libpri*.gz tar -xvf libpri*.tar # Assumes specific version cd libpri-1.6.0 make sudo make install cd .. # assumes specific version: cd asterisk-18.6.0 ./configure make sudo make install sudo make samples sudo make basic-pbx sudo make config # control-C will kill asterisk when you're done (maybe 2 or more control-C ) sudo asterisk -cvvvvvvv # how to get this history without line numbers: history -w /dev/stdout