update January 2022
Managed to reinstall everything on UBU 20

In general all went quite well.
Issues with screen resolution on the VGA monitor resolved

https://askubuntu.com/questions/1075157/unable-to-set-my-screen-resolution-higher.

and major issues finally resolved with mido - 

install Python 2
install Pip 2 - 
https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/
install build essential (with synpatic)
rtmidi installation instructions 
https://spotlightkid.github.io/python-rtmidi/installation.html#requirements

asterisk showed an error (during install)

chris@chris-UBU20:/usr/src/asterisk-16.23.0$ sudo contrib/scripts/get_mp3_source.sh
svn: E170013: Unable to connect to a repository at URL 'https://svn.digium.com/svn/thirdparty/mp3/trunk'
svn: E670003: Temporary failure in name resolution
chris@chris-UBU20:/usr/src/asterisk-16.23.0$ 

This may relate to issues later encountered when i forgot to install 123mpg and thus the MOH failed

Notes for the upgrade to UBU 20 in Jan 2022 as I remember them – details are in the asterisk reinstall afresh

Asterisk MOH relies on the icecast server running. The MOH config file will need updating for UBU 20

The two servers PRIMO and UBU20 use two different ports for the ice cast server- check that the various files that contain references to ports 8000 or 7000 are updated

Network – clashes occurred in NAT open ports with some open ports allocated to more than one IP – open ports for PRMO and UBU20 must not be duplicated

The right version of Python (2.7) must be installed a made default for any of the cereproc stuff to work. and Pip2 must be installed so that MIDO works.



GISS TV appeared to need to simple reset of the interface to work.

Could not figure how to install KX studio- abandoned

QJackctl – refused to allow the connection of the UMC 404 midi ports – I am not sure why then it did - Jack memory lockdown problems resolved somehow

Mido was a nightmare until Pip 2 was installed

Sox had some deprecated options  




https://computingforgeeks.com/how-to-install-asterisk-16-lts-on-ubuntu-18-04-16-04-debian-9/

for undo possibility install synaptic

for efficiency install dropbox

sudo apt update && sudo apt -y upgrade

sudo reboot

sudo apt -y install git curl wget libnewt-dev libssl-dev libncurses5-dev subversion  libsqlite3-dev build-essential libjansson-dev libxml2-dev  uuid-dev

sudo apt policy asterisk

cd /usr/src/

sudo curl -O http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz

sudo tar xvf asterisk-16-current.tar.gz

cd asterisk-16*/

sudo contrib/scripts/get_mp3_source.sh

sudo contrib/scripts/install_prereq install

Problem with libjansson at this point 
sudo ./configure --with-jansson-bundled

sudo make menuselect

sudo make

sudo make install

sudo make progdocs

sudo make samples

sudo make config

sudo ldconfig

sudo groupadd asterisk

sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk

sudo usermod -aG audio,dialout chris
sudo chown -R chris.chris /etc/asterisk
sudo chown -R chris.chris /var/{lib,log,spool}/asterisk
sudo chown -R chris.chris /usr/lib/asterisk


sudo gedit /etc/default/asterisk

	runuser = chris ; The user to run as.
	rungroup = chris ; The group to run as.

sudo gedit /etc/asterisk/asterisk.conf

	runuser = chris ; The user to run as.
	rungroup = chris ; The group to run as.


sudo systemctl restart asterisk

sudo systemctl enable asterisk

sudo asterisk -rvv

new terminal?

sudo ufw allow proto tcp from any to any port 5060,5061

install jack and pure data and sox through synaptic

sudo apt install python-pip

pip install mido

pip install rtmidi
(for UBU 20 all sorts of problems will occur at this point - i never resolved this)
check this out https://github.com/mido/mido/issues/145
and note this - 

There are three different RtMidi packages for Python. Mido requires the one called python-rtmidi.

copy asterisk config files to new machine

/etc/asterisk/extensions.conf
/etc/asterisk/sip.conf
/etc/asterisk/musiconhold.conf


in order to install PD 50 you need 

sudo apt-get install autoconf autogen

Problems occur at this point on some machines - I have no idea why

However on a more up to date machine although I accidentally installed PD in the downloads folder - will it matter it seems to work?

This is copied from the PD install instructions in the archive once expanded
 
Building Pd using the GNU autotools ./involves the following steps:

1. configure: detect & set library and platform options
2. make: compile Pd, associated tools, and resource files (ie. translations)
3. install: install the Pd binaries and resources onto your system

Overview:

    cd path/to/pd
    ./autogen.sh
    ./configure
    make

Start by opening a commandline shell and navigating to the Pd source directory:

    cd path/to/pd

First generate the configure script and various build files by running:

    ./autogen.sh

Next configure Pd with the default options for your platform:

    ./configure

    ./configure --enable-jack

     make 

problems with PD Jack memory - seems to be fixed with

Set 'DefaultLimitMEMLOCK=128M' in:
/etc/systemd/system.conf
/etc/systemd/user.conf

and set
 usermod -a -G audio theusername



set  all files here to executable and editable by all

/home/chris/Dropbox/K6_primo/scripts

include the cereproc app tts callback 

/home/chris/Dropbox/K6_primo/cerevoice_sdk/examples/python
and the cues text file

Pd extras etc in file prefrences path



/home/chris/.local/lib/pd/extra/cyclone
/user/lib/pd/extra
/user/lib/pd/extra/Gem
/home/chris/.local/lib/pd/extra

or

/usr/lib/puredata/extra


file/preferences/startup
zexy
Gem
list-abs 
nilwind
ggee
cyclone

some of these don't appear to be used anymore

there was a problem with list2 object in PD resolved once all the above were preloaded

Icecast and Darkice

tried installing from synaptic (this worked out of the box with UBU 20)

it seemed ok but launching the config script 
darkice -c /home/chris/Dropbox/K6/darkice/darkice3.cfg 
threw an error

DarkIce: TcpSocket.cpp:251: connect error [111]

so i did

/etc/init.d/icecast2 start

and then checked the open ports on the router



Icecast and Darkice

sudo sh -c "echo deb http://download.opensuse.org/repositories/multimedia:/xiph/xUbuntu_16.04/ ./ >>/etc/apt/sources.list.d/icecast.list"

Step 2: Import the Multimedia signing key
You need to add the openSUSE OBS Multimedia signing key as a Trusted Key to your system.

There are many ways to verify this key, e.g. by a simple web search.

After downloading the key, you can run this command to verify your copy:

gpg multimedia-obs.key

sudo chmod 666 /var/log/icecast2 

chmod 666 /usr/share/icecast2/web/status.xsl



























change ip address to 63
(only if replaces existing system)

Problems with nautilus for dropbox - trashes connection

in grandstream control panel http://192.168.1.10/
- FXS port changed refrences from cloud to K6primo

in etc/asterisk
extensions.conf - changed all refrences to cloud to K6primo
sip conf - changed all refrences to cloud to K6primo

copied cerevoice_sdk folder to var/lib/
changed permissions in examples/basictts/ to exec for audio.voice, basictts, tts_callback, txt2wav

copied pd folder to var/lib/asterisk/
aded scripts count_poems, miditoPd, ringbash, killring, ringmido to scripts and made executable

copied sounds/chris folder to var/lib/asterisk/sounds


Basic installation now working

Started Jack and Pd -fiddle to connect all operating ok

Options changed in Sox - assuming them to be depracated code ammended to 
sox /var/lib/asterisk/sounds/chris/ttsoutput.wav -t raw -r 8000 -c 1 /var/lib/asterisk/sounds/chris/render/ttsoutput.sln

the N and -s options removed

Update Jan 2022 for UBU 20 options changed again in Sox entries in dialplan - extensions.conf
exten => _.,n,System(sox /home/chris/Dropbox/K6_primo/speech_audio/misdial.wav -t raw -r 8000 /home/chris/Dropbox/K6_primo/render/tts_callback.sln)



















serious isues with permissions - i think. 
resolution was to change the default account for all the asterisk functions to Chris thus

sudo usermod -aG audio,dialout chris
sudo chown -R chris.chris /etc/asterisk
sudo chown -R chris.chris /var/{lib,log,spool}/asterisk
sudo chown -R chris.chris /usr/lib/asterisk
sudo gedit /etc/default/asterisk

	AST_USER="chris"
	AST_GROUP="chris"

sudo gedit /etc/asterisk/asterisk.conf

	runuser = chris ; The user to run as.
	rungroup = chris ; The group to run as.

iT ALL WORKS






sudo usermod -aG audio,dialout 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

or



		
	runuser = asterisk ; The user to run as.
	rungroup = asterisk ; The group to run as.
or

runuser = asterisk ; The user to run as.
	rungroup = asterisk ; The group to run as.

Change default Python version to 2.7

How to switch between alternative Python Versions step by step instructions

https://linuxconfig.org/install-python-2-on-ubuntu-20-04-focal-fossa-linux

  1.  First step is to check what python versions are available on your Ubuntu system. To do so execute the following command:$ ls /usr/bin/python* /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.7 /usr/bin/python3.7m /usr/bin/python3.8 /usr/bin/python3-futurize /usr/bin/python3m /usr/bin/python3-pasteurize
  2. Next, check if you already have some python alternatives configured. To do so run:sudo update-alternatives –list python update-alternatives: error: no alternatives for python Currently the system has no python alternatives configured.
  3. In this step we are going to set two Python alternatives, namely it will by Python2 and Python3 alternative. Execute the following commands:$ sudo update-alternatives –install /usr/bin/python python /usr/bin/python2 1 $ sudo update-alternatives –install /usr/bin/python python /usr/bin/python3 2
  4. Confirm that both alternatives are ready to be used:$ sudo update-alternatives –list python /usr/bin/python2 /usr/bin/python3
  5. Change to alternative python version. For example to change to Python 2 execute the following command:$ sudo update-alternatives –config python There are 2 choices for the alternative python (providing /usr/bin/python). Selection Path Priority Status ———————————————————— * 0 /usr/bin/python3 2 auto mode 1 /usr/bin/python2 1 manual mode 2 /usr/bin/python3 2 manual mode Press to keep the current choice[*], or type selection number: 1 Enter selection number. In this case to switch to Python version 2 we enter the 1 selection number.
  6. Check your python version:$ python -V Python 2.7.17 To switch to Python 3 alternative repeat Step 5 and enter the selection number appropriate to your desired python version.

Leave a Reply

Your email address will not be published. Required fields are marked *