Skip to content

SIP daemon that turns a Raspberry Pi into a hardware VOIP telephone.

License

Notifications You must be signed in to change notification settings

Quintus/piphoned

Repository files navigation

piphoned
========

piphoned is a SIP client for the Raspberry Pi. My goal is to make this
an implementation good enough to work for my own desktop phone, but it
isn’t finished yet.

Outgoing calls are completely supported already, incoming calls work
most of the time, but not always. The implementation even nominally
supports encryption by means of ZRTP, but I was unable to test it yet
for lack of a ZRTP-capable SIP server.

Dependencies
------------

This is a UNIX daemon and as such requires a UNIX system; due to the
dependency on linphone, most likely Linux is required. It is written
in C, so you also need a C compiler to build it, and additionally, you
need the following external libraries:

* wiringPi
* Linphone, at least version 3.8.0, with ZRTP support enabled

Configuration
-------------

An example configuration file is included in
data/piphoned.conf.sample, as is a sample systemd service file.

Running
-------

Remember this is unfinished software that I only occasionally work
on. It is not recommended to run this if you are not familiar with the
codebase, so please read the sourcecode before you do.

The daemon binary, piphoned, supports the standard “start” and “stop”
commands along with a number of commandline options. Use -h to get a
list of them.

Caveats
-------

On Debian, the user running piphoned must be in the “audio” group, or
it won’t have access to any sound devices, which is bad for a
telephone. You can add the user to the group like this:

    # usermod -aG audio youruser

Likewise, you need to have the kernel module for sound access on the
Raspberry Pi, `snd-bcm2835`, loaded. If you don’t, you’ll see a lot of
lines like:

    (parse_card) cannot find card '0'
    (_snd_config_evaluate) function snd_func_card_driver returned error: File or Directory not found
    (snd_func_concat) error evaluating strings
    function snd_func_concat returned error: File or Directory not found
    (snd_pcm_open_noupdate) Unknown PCM default

And many more, cryptic error messages. So load the kernel module:

    $ modprobe snd-bcm2835

You can add it to `/etc/modules` if you want to load it at boot time
(recommended). To test your sound, install the `alsa-utils` package
via APT and run this:

    $ aplay /usr/share/sounds/alsa/Front_Center.wav

You should now hear a voice saying “Front, Center” on the speaker
plugged into the pi’s audio jack.

To retrieve the names of the sound devices for the `piphoned.conf`
file, use the supplied `piphoned-soundcards` executable. Its output
should look like this if both kernel module and group are set up
correctly:

    $ ./piphoned-soundcards
    ALSA lib conf.c:4705:(snd_config_expand) Unknown parameters 0
    ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL default:0
    ortp-warning-Could not attach mixer to card: Invalid argument
    ALSA lib conf.c:4705:(snd_config_expand) Unknown parameters 1
    ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL default:1
    ortp-warning-Could not attach mixer to card: Invalid argument
    --- List of detected devices ---
    Device 0: ALSA: default device
    Device 1: ALSA: bcm2835 ALSA
    Device 2: ALSA: USB PnP Sound Device
    Device 3: PulseAudio: default
    --- End of list of detected devices ---

If you see lines like

    ortp-warning-Strange, sound card default device seems totally unusable.

, then your audio devices are not set up properly.

License
-------

piphoned is a SIP client for the Raspberry Pi.
Copyright (C) 2015  Marvin Gülker

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

About

SIP daemon that turns a Raspberry Pi into a hardware VOIP telephone.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published