PSTN fun

From Hackerspace Brussels
Revision as of 02:26, 4 September 2011 by 2001:6f8:147f:42:221:ccff:fe38:c7a3 (Talk) (Speex)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Encrypted phone system based on cheap phones and PC soundcards.

Test System[edit]

PBX[edit]

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

Small phones easy to interface with soundcard[edit]

Stereo to mono splitter[edit]

  • homebrew
  • ebay 1 2

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

Ideas[edit]

Reusing audsl[edit]

audsl is a software modem implementation, using yr soundcard as a DAC/ADC http://www.araneus.fi/audsl/

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."

Compiling audsl (aka make)[edit]

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

Compiling tests (aka make test)[edit]

To avoid compiler errors, include <cstdio> in test/test-hdlc-tx.cc

OSS/ALSA issues[edit]

[/dev/dsp is missing][edit]

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.

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

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
 done

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

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));
           exit(1);
       }
       if (stereo != 0) {
           fprintf(stderr, "Audio device does not support mono mode\n");
           exit(1);          
       }

Unsolved - hw problem ?

Speex[edit]

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

Links[edit]

Books[edit]

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

Tutorials[edit]