Difference between revisions of "ASL-AsteriskNG"

From "PTTLink Wiki"
Jump to navigation Jump to search
m (Protected "ASL-AsteriskNG": Status page of an actively developed project ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading])
(Updated compiling/config information from README.md)
Line 12: Line 12:
  
 
== Compiling ==
 
== Compiling ==
 +
(From README.md)
 +
 +
This code has been successfully compiled on both Debian Stretch (9.4.0) and Ubuntu 16.04. For Ubuntu 16.04, you will only need to use libdev-ssl and not libdev1.0-ssl. The following commands below will download the files compile them and install them.
 +
 +
===Using setup.sh script===
 +
 +
To automatically build and install the port and all associated files:
 +
<pre>
 +
# https://github.com/pttlink/ASL-AsteriskNG/raw/master/setup.sh
 +
# sh setup.sh
 +
</pre>
 +
 +
===Compiling by hand===
 +
 +
If you prefer to do all the steps yourself:
 +
 +
<pre>
 +
# Ensure that the necessary repos for Debian are added to sources.list
 +
# echo "deb-src http://mirrors.kernel.org/debian/ stretch main" >> /etc/apt/sources.list
 +
# echo "deb-src http://mirrors.kernel.org/debian/ stretch-updates main" >> /etc/apt/sources.list
 +
# echo "deb-src http://security.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
 +
 +
# Update and install the requirements needed to build the system
 +
# apt-get update
 +
# apt-get install -y git build-essential linux-headers-$(uname -r) linux-source-4.9 libss7-dev wget apt-utils \
 +
dahdi-source dahdi-linux aptitude tcsh gawk libusb-dev doxygen
 +
 +
# Download the sources
 +
# cd /usr/work
 +
# git clone https://github.com/pttlink/ASL-AsteriskNG.git
 +
# wget https://github.com/KG7QIN/AllStarLink/raw/master/dahdi/dahdi-linux-complete-2.10.2%2B2.10.2.tar.gz
 +
 +
# Run the Asterisk prereq install script
 +
# mkdir /etc/vpb
 +
# cd /usr/work/ASL-AsteriskNG
 +
# sh /usr/work/ASL-AsteriskNG/contrib/scripts/install_prereq install
 +
 +
# Fix some dependencies that may have changed due to the prereq script running
 +
# apt-get install -y libssl1.0-dev
 +
 +
# Extract, build and load the DAHDI modules
 +
# cd /usr/work/
 +
# tar -zxf dahdi-linux-complete-2.10.2+2.10.2.tar.gz
 +
# cd /usr/work/dahdi-linux-complete-2.10.2+2.10.2/tools/xpp/
 +
# sed -i -e 's/inline /extern inline /g' echo_loader.c
 +
 +
# cd /usr/work/dahdi-linux-complete-2.10.2+2.10.2/
 +
# sed -i -e 's/configure /configure CFLAGS=-Wno-error /g' Makefile
 +
# cd tools/xpp
 +
# sed -i -e 's/-I. -Ixtalk -Wall -Werror/-I. -Ixtalk -Wno-error/g' Makefile
 +
# cd ../../
 +
# make distclean
 +
# make
 +
# make install
 +
# make config
 +
 +
# Load DAHDI module
 +
# modprobe dahdi
 +
 +
# Build ASL-AsteriskNG with ASL port
 +
# By default debugging code is included in this build using the -g option below
 +
# cd /usr/work/ASL-AsteriskNG/
 +
# make distclean
 +
# ./configure LDFLAGS="-zmuldefs -lasound" CFLAGS="-Wno-unused -Wno-all -Wno-int-conversion -g"
 +
# make menuselect.makeopts
 +
# menuselect/menuselect --enable app_rpt --enable chan_beagle --enable chan_tlb --enable chan_usrp --enable chan_rtpdir --enable chan_usbradio --enable chan_simpleusb --enable chan_echolink --enable app_gps --enable chan_voter --enable radio-tune-menu --enable simpleusb-tune-menu  menuselect.makeopts
 +
# make
 +
# make install
 +
# make samples
 +
# make progdocs
 +
 +
# Now run the post-setup script
 +
# cd /usr/work/ASL-AsteriskNG
 +
# sh ./post_ast_setup.sh
 +
</pre>
 +
 +
===Using Docker to run===
 +
 +
A Dockerfile has been created that will allow you to build this code as it currently is and run it. 
 +
The base image is Debian Stretch (9.4.0).
 +
 +
To build:<br/>
 +
Grab the Dockerfile from the Docker directory and place in directory by itself
 +
<pre>
 +
# docker build -t asl1.8-test3 .
 +
</pre>
 +
 +
To run:
 +
<pre>
 +
# docker run -v /dev/dahdi:/dev/dahdi -v /dev/dsp:/dev/dsp  --privileged --net=host -d --name ASL -i -t asl1.8-test3
 +
</pre>
 +
 +
Note:  You will need to have successfully built the DAHDI kernel modules with the AllStarLink patches and have this module loaded into your host OS's kernel.
 +
 +
Make sure that you connect to the container's shell and configure the node's rpt.conf and other required files under /etc/asterisk.  Example files are included.
 +
 +
To connect to the Asterisk console:
 +
<pre>
 +
# docker exec -it ASL sh /usr/sbin/asterisk -cvvvr
 +
 +
For just a shell prompts on the running container:
 +
# docker exec -it ASL sh
 +
</pre>
 +
 +
When the container is started, it will automatically kick off running the /etc/asterisk/rc.updatenodelist file and asterisk as well.
 +
 +
You can cleanly shutdown Asterisk and stop the container by running from the Asterisk CLI "core stop gracefully" or "core stop now"
 +
 +
Once you configure the node you will need to either reload asterisk or stop and start the container again.
 +
 +
Congratulations!  If all went well, you will have a complete install of Asterisk 1.8 with the AllStarLink app_rpt programs on your computer.
 +
 +
Note that these steps are purposely compiling Asterisk and modules with debugging info (-g).  This is to make it easier to collect information about various problems while testing the port out.
 +
 +
Please test and abuse this and let us know what problems you find via the github repo.
 +
 +
==Notes==
 +
 +
There are also some changes that you will need to make to your extensions.conf file (or you an opt to convert it to either extensions.ael or extensions.lua).
 +
 +
One of these changes is how app_rpt is called.
 +
 +
Convert any of your lines that are similar to this:
 +
Rpt(${EXTEN:1}|Pv|${CALLERID(name)}-P)
 +
 +
To this:
 +
 +
Rpt(${EXTEN:1},Pv,${CALLERID(name)}-P)
 +
 +
Commas have replaced the | in Astersk 1.8's dialplan.  Failure to update your extensions.conf will result in Asterisk not loading it correctly.

Revision as of 20:38, 18 January 2021

ASL-AsteriskNG is the next generation app_rpt client based on the KG7QIN's port to Asterisk 1.8.

You can find the official ASL-AsteriskNG repo at https://www.github.com/pttlink/ASL-AsteriskNG

Current Status

WIP. app_rpt does run. This is the code that powers the PTTLink phone portal and powered (powers?) the AllStarLink phone portal. Refer to the issues section in the repo and the README for more information.

Note: This code is very much ALPHA quality code and should be used only at your own risk.

Downloads

Compiling

(From README.md)

This code has been successfully compiled on both Debian Stretch (9.4.0) and Ubuntu 16.04. For Ubuntu 16.04, you will only need to use libdev-ssl and not libdev1.0-ssl. The following commands below will download the files compile them and install them.

Using setup.sh script

To automatically build and install the port and all associated files:

# https://github.com/pttlink/ASL-AsteriskNG/raw/master/setup.sh
# sh setup.sh 

Compiling by hand

If you prefer to do all the steps yourself:

# Ensure that the necessary repos for Debian are added to sources.list
# echo "deb-src http://mirrors.kernel.org/debian/ stretch main" >> /etc/apt/sources.list 
# echo "deb-src http://mirrors.kernel.org/debian/ stretch-updates main" >> /etc/apt/sources.list 
# echo "deb-src http://security.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list

# Update and install the requirements needed to build the system
# apt-get update 
# apt-get install -y git build-essential linux-headers-$(uname -r) linux-source-4.9 libss7-dev wget apt-utils \
	dahdi-source dahdi-linux aptitude tcsh gawk libusb-dev doxygen

# Download the sources
# cd /usr/work 
# git clone https://github.com/pttlink/ASL-AsteriskNG.git 
# wget https://github.com/KG7QIN/AllStarLink/raw/master/dahdi/dahdi-linux-complete-2.10.2%2B2.10.2.tar.gz

# Run the Asterisk prereq install script
# mkdir /etc/vpb 
# cd /usr/work/ASL-AsteriskNG
# sh /usr/work/ASL-AsteriskNG/contrib/scripts/install_prereq install 

# Fix some dependencies that may have changed due to the prereq script running
# apt-get install -y libssl1.0-dev

# Extract, build and load the DAHDI modules
# cd /usr/work/ 
# tar -zxf dahdi-linux-complete-2.10.2+2.10.2.tar.gz 
# cd /usr/work/dahdi-linux-complete-2.10.2+2.10.2/tools/xpp/
# sed -i -e 's/inline /extern inline /g' echo_loader.c

# cd /usr/work/dahdi-linux-complete-2.10.2+2.10.2/
# sed -i -e 's/configure /configure CFLAGS=-Wno-error /g' Makefile
# cd tools/xpp 
# sed -i -e 's/-I. -Ixtalk -Wall -Werror/-I. -Ixtalk -Wno-error/g' Makefile 
# cd ../../ 
# make distclean 
# make 
# make install 
# make config

# Load DAHDI module
# modprobe dahdi

# Build ASL-AsteriskNG with ASL port
# By default debugging code is included in this build using the -g option below
# cd /usr/work/ASL-AsteriskNG/
# make distclean 
# ./configure LDFLAGS="-zmuldefs -lasound" CFLAGS="-Wno-unused -Wno-all -Wno-int-conversion -g" 
# make menuselect.makeopts
# menuselect/menuselect --enable app_rpt --enable chan_beagle --enable chan_tlb --enable chan_usrp --enable chan_rtpdir --enable chan_usbradio --enable chan_simpleusb --enable chan_echolink --enable app_gps --enable chan_voter --enable radio-tune-menu --enable simpleusb-tune-menu  menuselect.makeopts
# make
# make install
# make samples
# make progdocs

# Now run the post-setup script
# cd /usr/work/ASL-AsteriskNG
# sh ./post_ast_setup.sh

Using Docker to run

A Dockerfile has been created that will allow you to build this code as it currently is and run it. The base image is Debian Stretch (9.4.0).

To build:
Grab the Dockerfile from the Docker directory and place in directory by itself

# docker build -t asl1.8-test3 . 

To run:

# docker run -v /dev/dahdi:/dev/dahdi -v /dev/dsp:/dev/dsp  --privileged --net=host -d --name ASL -i -t asl1.8-test3

Note: You will need to have successfully built the DAHDI kernel modules with the AllStarLink patches and have this module loaded into your host OS's kernel.

Make sure that you connect to the container's shell and configure the node's rpt.conf and other required files under /etc/asterisk. Example files are included.

To connect to the Asterisk console:

# docker exec -it ASL sh /usr/sbin/asterisk -cvvvr

For just a shell prompts on the running container:
# docker exec -it ASL sh

When the container is started, it will automatically kick off running the /etc/asterisk/rc.updatenodelist file and asterisk as well.

You can cleanly shutdown Asterisk and stop the container by running from the Asterisk CLI "core stop gracefully" or "core stop now"

Once you configure the node you will need to either reload asterisk or stop and start the container again.

Congratulations! If all went well, you will have a complete install of Asterisk 1.8 with the AllStarLink app_rpt programs on your computer.

Note that these steps are purposely compiling Asterisk and modules with debugging info (-g). This is to make it easier to collect information about various problems while testing the port out.

Please test and abuse this and let us know what problems you find via the github repo.

Notes

There are also some changes that you will need to make to your extensions.conf file (or you an opt to convert it to either extensions.ael or extensions.lua).

One of these changes is how app_rpt is called.

Convert any of your lines that are similar to this: Rpt(${EXTEN:1}|Pv|${CALLERID(name)}-P)

To this:

Rpt(${EXTEN:1},Pv,${CALLERID(name)}-P)

Commas have replaced the | in Astersk 1.8's dialplan. Failure to update your extensions.conf will result in Asterisk not loading it correctly.