parole

Introduction

parole is a simple voip program that lets you make a voice call from the terminal, without having to register an account, exchange emails, add people to contact lists etc. All you need is the IP address of the other person you want to call.
Starting a voice call is as simple as running "parole -l" on one pc (this one will listen for incoming calls) and "parole -c host" on the other one.
It also supports encrypted calls with a symmetric key (using xtea-cbc) and call recording (still experimental).

License

parole is released under the GNU GPLv3 license.

How to compile parole

parole is written in C an uses alsa to access the sound card, and libopus to compress the audio stream. In addition it also uses libogg to record the call in ogg/opus format. Since it is a relatively simple program, there is no configure script. In order to compile parole you need:

  1. gcc
  2. make
  3. libasound
  4. libopus
  5. libogg

Under Debian/Ubuntu all the dependencies, except libopus, should be satisfied by installing the following packages:

build-essential libasound2-dev libogg-dev

To build libopus from source you can run the following commands:

$ mkdir src
$ cd src
$ wget http://downloads.xiph.org/releases/opus/opus-1.0.2.tar.gz
$ tar xvzf opus-1.0.2.tar.gz
$ cd opus-1.0.2/
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
# you can later uninstall with:
#$ sudo make uninstall
			

Once the dependencies are satisfied, you can compile the program simply with:

$ make

If you want to clean the build directory just run:

$ make clean

The resulting binary can be put, for example, in /usr/local/bin or can be run from the local directory.

Using parole

You can access the help by running:

$ ./parole -h
parole, ver. 0.10beta4

Usage: parole [options] [-l | -c host]
Options:
       -h             print help
       -v             increment verbosity level
       -p port        listening port            (8110)
       -b bitrate     set bitrate in bit/s      (16000)
       -d audiodev    use audio device audiodev (hw:0,0)
       -a             autoaccept calls
       -e             encrypt call with xtea-cbc
       -k keyfile     read key from keyfile
       -r             record call in ogg/opus
Modes:
       -l             listen for calls
       -c host[:port] call host
			

The values in parentheses on the right are the default values.

To establish a voice call, one user has to run parole in 'listening mode', and wait for an incoming call. This is done by running:

$ ./parole -l

or

$ ./parole -l -p PORT

Use the second command if you want to specify a listening port different from 8110 (which is the default one). Note that if you are using a router from a home connection and want people to be able to call you from the outside, you'll most likely need to forward this port.
The other user will call the host that is listening with:

$ ./parole -c host[:port]

Again if port is omitted, port 8110 will be used. Note that host can be either an IP address or a hostname. Once a call arrives, you'll hear a ringtone and parole will ask you if you want to accept it (unless you have used the -a option to autoaccept calls) and then the communication will begin. When you're done simply press CTRL-C to end the conversation. If you started parole with -l, press CTRL-C one more time when you want to quit the program, otherwise it'll wait until another call arrives.

Audio options

parole uses alsa for audio capture and playback. You can specify the alsa device to use with -d option. If you get and error with the default device (hw:0,0), try 'plughw:0,0'. It should be possible to use pulseaudio with -d pulse.
Note that internally parole uses the following format: 2 channels, 48000Hz sampling rate, s16_le format. So if your sound card does not support this format you're likely to get an error when alsa is initialized.

To choose the bitrate of the compressed opus stream, option -b can be used. The default is set at 16000 bit/s and should give very good quality with a typical bandwidth of 2.5kbyte/s.

Encryption

parole supports basic encryption with a symmetric key (that is, people wanting to make an encrypted call must decide a common key before starting the call). This key is 128-bit long, and can be represented by a 32-char hexadecimal number. To encrypt a call the caller must use the -e option, in which case the program will ask both parts to enter the key and will start the communication only if the keys match. If the key you enter is composed of less than 32 characters, it will be padded with '0's. The key can also be read from a file, using the -k option.
Example on how to create a key from a passphrase:

$ echo -n "put passphrase here" | md5sum | cut -b 1-32 > keyfile

keyfile will now contain a 128bit hexadecimal number.

Recording calls

This feature can be enable with -r option, and it is still experimental.

Download

The following versions of parole are available for download. Please note that parole is still in development and it should be considered beta software. We recommend you to download the latest version.

Changelog

version 0.10beta4:

	* Display libopus complexity setting
	* Moved write_ogg_packet() to oggopus.c
	* Imported new version of audio.c from hwebcam
	* Added common.{h,c} (message printing utilities)
	* Cosmetics fixes

version 0.10beta3:

	* Added variable to count overruns
	* Added addr field to struct udp_packet_st and updated code
	* Changed start_threshold for playback to 40ms
	* Request 10 periods (200ms ringbuffers) to alsa driver
	* Minor cosmetic changes

version 0.10beta2:

	* Cleanup: removed variables peak_count and t_poll
	* Added code to handle alsa buffer overrun
	* Check poll() return value properly
	* Changed start_threshold for playback to 80ms

version 0.10beta1:

	* Check sendto() return value properly
	* Update audio peak every second

version 0.10beta0:

	* Initial release
			

Valid XHTML 1.0 Strict

Copyright (C) 2013 Giorgio Vazzana