A few simple capi test programs.

GetProfile : This program retrieves the isdn-cards capability information. The print out should look like eicondiva.txt.

SimpleSpeechReceive : This program listens to incoming calls. If somebody calls, SimpleSpeechReceive picks up the 'phone' and saves the bytes coming from the telephone network in a file called uk/co/mmscomputing/device/capi/samples/capture.raw.

SimpleSpeechSend : A program that sends uk/co/mmscomputing/device/capi/samples/capture.raw to a 'remote' phone. SimpleSpeechSend needs a valid telephone number : java uk.co.mmscomputing.device.capi.samples.SimpleSpeechSend 004412345678

(Run SimpleSpeechReceive first, say your 'Hello world, I feel great!' when connected, then run SimpleSpeechSend and listen to your own voice.)

(In case you wonder what to do with the raw byte stream, have a look at project uk.co.mmscomputing.device.capi.sound, uk.co.mmscomputing.sound.
Run Raw2WaveConverter to convert the raw capture.raw file into the wave files capturePCM.wav, captureALaw.wav and captureuLaw.wav)

(Above programs are only very basic test programs !)

SpeechSend : A program that sends either a raw 'soundfile' or an audio file to the 'remoteno' phone. SpeechSend needs a valid telephone number and an audio source file: java uk.co.mmscomputing.device.capi.samples.SpeechSend remoteno srcfile

SimpleVoiceBox : This program listens for incoming calls but accepts only the caller with phone number remoteno. After the program has accepted a call it sends all .wav files in srcpath to the caller. SimpleVoiceBox needs a valid telephone number and a path to a directory with .wav audio source files: java uk.co.mmscomputing.device.capi.samples.SimpleVoiceBox remoteno srcpath

(This works of course only, if your ISDN line supports Caller Line Identification (CLI) and the Caller does not withhold her number.
The remote number needs to be with (country) area code but without the leading zero(s).)

SimpleDTMFActuator : A program that accepts a call and then listens for a certain dtmf sequence. Once it has received this sequence it will run a command (i.e. script) in a seperate process.
SimpleDTMFActuator needs a DTMF sequence and a command: java uk.co.mmscomputing.device.capi.samples.SimpleDTMFActuator dtmfs command
java uk.co.mmscomputing.device.capi.samples.SimpleDTMFActuator 1234 "java -version"

(This will work only, if your card supports DTMF.)

Answerphone : A command line answerphone application.

EchoPhone : A weird program that calls 'remoteno' and echoes back whatever the remote peer sends. Its main purpose is to hear how big the latency is that (j)capi introduces.
EchoPhone needs a valid telephone number : java uk.co.mmscomputing.device.capi.samples.EchoPhone 004412345678

The latency depends on the size of the maxBDataLen in jcapi.register. The default is 256 bytes. Hence at least 32 ms latency.

TalkTo : A program that calls 'remoteno'. It sends everything from the default audio input (i.e. microphone) to the remote phone and outputs everything it receives to the default audio output (i.e. speaker). Its main purpose is to hear how big the latency is that (j)capi + the java audio system introduces. It is a simple caller application.

The latency depends on the java audio system. Depending on what mixer the system uses, the latency can be rather high (with rather strange sound effects; i.e whaleish).
Newer versions of java use on WinXP by default DirectX, and on Linux the ALSA system (in my case: SuSE 9.1; java 1.5.0beta; Direct Audio Device: NVidia nForce2), which allows real time conversations.

SFF stands for Structured Fax Format and is defined in [1] Annex B.

[1] Common-ISDN-API Part I :www.capi.org/download/capi20-1.pdf CAPI Association e.V. [last accessed : 2003-06-24]

Projects :
  1. uk.co.mmscomputing.application.answerphone:
    Answer Phone Application.
  2. uk.co.mmscomputing.device.capi.sound:
    Classes that turn the CAPI device audio streams into an A-Law, u-Law or PCM stream.
  3. uk.co.mmscomputing.imageio.sff:
    Classes that enable the java imageio system to read and write *.sff (structured fax format) files.
  4. uk.co.mmscomputing.imageio.tiff:
    Classes that enable the java imageio system to read and write *.tif (Tagged Image File Format ) files.