This is a repository containing some code artifacts but mostly testing fragments for a project to develop a device to connect landline phones to other landline phones via a private VoIP network. At time of writing of this README (July 2024) efforts are mostly focused on the design of the hardware side of the project, but this repository may come to house more complete companion software as the project grows.
Ring phone via software- Completed in ring.py
Play audio on phone speaker- Completed in wav.py
Receive audio from phone and convert to digital signal- Parse DTMF signals for dialing
- Create system for initial phone setup
- Create web app for call routing and social networking
The Pi is set up with the hostname peterpi.local
and can be SSH'ed to using the username recurse
.
ssh recurse@peterpi.local
sudo sed --in-place=.bak --expression='s/^#PermitEmptyPasswords no/PermitEmptyPasswords yes/g' /etc/ssh/sshd_config
sudo systemctl restart sshd
sudo passwd -d recurse
These commands are used to send sine wave signals to the speakers of the Pi. By correctly routing the output audio device of the Pi to "headphones" routed to pins, these signals can be sent to the phone. The following two sine waves are the frequencies used in a standard dial tone.
speaker-test -t sine -f 350 -l0
speaker-test -t sine -f 440 -l0
cross build --target=arm-unknown-linux-gnueabihf
scp phoneodeo.dts recurse@peterpi.local:
scp bootconfig.txt recurse@peterpi.local:
dtc -@ -H epapr -O dtb -o phoneodeo.dtbo -Wno-unit_address_vs_reg phoneodeo.dts
sudo cp phoneodeo.dtbo /boot/overlays
sudo chown root:root bootconfig.txt
sudo chmod 755 bootconfig.txt
sudo cp bootconfig.txt /boot/firmware/config.txt
scp goertzel/phreak.service recurse@peterpi.local:
scp goertzel/target/arm-unknown-linux-gnueabihf/release/goertzel recurse@peterpi.local:
sudo chown root:root ~/phreak.service
sudo chmod 777 ~/phreak.service
sudo mv ~/phreak.service /etc/systemd/system
sudo systemctl disable phreak.service
sudo systemctl enable phreak.service
scp asoundrc recurse@peterpi.local:.asoundrc
sudo cp .asoundrc /root
amixer sset PCM -M '40%'
sudo alsactl store
sudo nmcli connection delete 'Recurse Center'; sudo reboot
brew tap messense/macos-cross-toolchains
brew install arm-unknown-linux-gnueabihf
cargo build --release --target=arm-unknown-linux-gnueabihf
wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
tar -xzvf asterisk-20-current.tar.gz
cd asterisk-20.9.3
./contrib/scripts/install_prereq install &&
./configure &&
make &&
make install
Cygwin:
socat -t30 -T30 UDP4-RECVFROM:5060,fork UDP4:"$(wsl hostname -I | tr -d ' ')":5062 &
socat -t30 -T30 UDP4-RECVFROM:5061,fork UDP4:"$(wsl hostname -I | tr -d ' ')":5063 &
PowerShell (administrator):
netsh interface portproxy add v4tov4 listenaddress=x.x.x.x listenport=22 connectaddress=$($(wsl hostname -I).Trim()) connectport=22
netsh advfirewall firewall add rule name=”Open Port 22 for WSL2” dir=in action=allow protocol=TCP localport=22
- SLIC datasheet
- gpiozero docs
- Cringely-named DT overlay
- Comment out playback and codec_out
- dai-tdm-slot-width to 24
- Add in capture_link block mclk-fs = <256>
- Add in r_codec_dai system-clock-frequency = <2560000>