PSTN fun

From Hackerspace Brussels
Jump to: navigation, search

Encrypted phone system based on cheap phones and PC soundcards.


[edit] Test System

[edit] PBX

  • schaarbeek fleemarket visit
  • ebay (got one similar to here)

[edit] Small phones easy to interface with soundcard

[edit] Stereo to mono splitter

  • homebrew
  • ebay 1 2

[edit] PC with a soundcard and ALSA-libs installed

[edit] Ideas

[edit] Reusing audsl

audsl is a software modem implementation, using yr soundcard as a DAC/ADC

it's a bit dated using OSS as audio api, we should get it patched to use ALSA

From [1]:

"AuDSL is an experimental software modem for low-speed Internet connectivity over leased copper lines using PC sound cards as the line interface. The acronym AuDSL stands for Audio Digital Subscriber Line."

[edit] Compiling audsl (aka make)

To avoid g++ errors, include <sys/socket.h> in

[edit] Compiling tests (aka make test)

To avoid compiler errors, include <cstdio> in test/

[edit] OSS/ALSA issues

[edit] [/dev/dsp is missing]

AuDSL is based on OSS and needs /dev/dsp and /dev/mixer devices to run. If your Linux distribution supports ALSA oss-emulation (Ubuntu 10.04 LTS and Debian do), load snd-pcm-oss module.

[edit] [audsld - playback mmap: Input/output error]

Since AuDSL uses OSS mmap() function, some permissions must be set. That was solved by [2]. Run the code above to solve it:

 for pcm in `find /proc/asound -name 'pcm*p'`; do
   echo erase >${pcm}/oss
   echo erase >${pcm%p}c/oss
   echo audsld 0 0 direct >${pcm}/oss
   echo audsld 0 0 disable >${pcm%p}c/oss

[edit] [Audio device does not support mono mode]

That's from a ioctl call which sets the MONO mode in your soundcard (audio-io.h,56):

       int stereo = 0;
       if (ioctl(fd, SNDCTL_DSP_STEREO, &stereo) == -1) {
           fprintf(stderr, "SNDCTL_DSP_STEREO: %s\n", strerror(errno));
       if (stereo != 0) {
           fprintf(stderr, "Audio device does not support mono mode\n");

Unsolved - hw problem ?

[edit] Speex

Patent-free audio compression format designed for speech [3]

[edit] Links

[edit] Books

  • Understanding Telephone Electronics, Fourth Edition book
  • Linux Audio Programming (Chapter 5) - Programming Linux Games book

[edit] Tutorials