#summary|Voice and video calls with Psi/Psi+ (en)

#labels Phase-Deploy,Featured

= Introduction =

What is it about?

This is an implementation of XEP-0167. In other words, it's an XMPP Extension Protocol, which describes how XMPP clients may transmit audio and video streams and this page deals with the implementation in Psi.

Together with XEP-0167, several other technologies are used. One of them is the multimedia back-end GStreamer, another is the ICE transport layer, described in XEP-0176.

GStreamer is considered to be one of the most powerful multimedia frameworks available. It can be easily extended and it is used by many third-party developers (It is used by almost all multimedia applications in Gnome. In KDE it can be used together with Phonon).

ICE (in this case specifically Jingle ICE-UDP) describes the process of establishing connections between clients, which ports are used, etc. (for details, look at the specification).

Regarding the ports used for data transmissing, by default, UDP port 8010 and some ports above that will be used. ICE in general allows any port to be used however.

The project page is here http://delta.affinix.com/psimedia/.|You can download a precompiled psimedia for several OSs there.

Compatibility with various operating systems
Building on `*`nix systems

Psimedia is used to encode/decode the media stream together with GStreamer. Other frameworks are not supported anymore and are unmaintained.

Requirements for building

*IMPORTANT:* For the packages that are bold, you will also need to have the headers. Most systems include this in extra dev packages.

Officially only glib 2.19.x is necessary (it's not clear which version psimedia requires to work without problems).

Plug-ins: speex, v4l, v4l2, theora, ogg, alsa, jpeg.

Building process

A simple script to do the build when the requirements are installed, can be found here.

Before building, you need to specify the Psi installation path. in case no prefix (–prefix) was specified when configuring Psi (configure), Psi was installed in /usr/local, and the installation path for the plug-in will be /usr/local/lib/psi/plugins. In many cases the prefix will be /usr; in which case the plug-in needs to be put in /usr/lib/psi/plugins. Keep this in mind when following the instructions below.

svn co https://delta.affinix.com/svn/trunk/psimedia

cd psimedia

qconf

./configure

make

mkdir -p /usr/local/lib/psi/plugins/

cp gstprovider/libgstprovider.so /usr/local/lib/psi/plugins/

When building fails with the following error:

cc1: warnings being treated as errors

you can try the following:

sed 's/ -Werror//' -i gstprovider/gstelements/static/static.pro

but it should be able to work without this :-)

Testing

To test, run demo/demo once the build is finished. In the demo program, copy-paste the codec line into the box below to get the same image there.

Connecting over IPv4 using STUN

If you are behind a router performing Network Address Translation (NAT), then you also need to set up a STUN server. This can be set up on the last tab in the account settings. You can use stun.ekiga.net (if it doesn't operate, you need to set your external IP address manually), port 3478.

Also check your voice call settings in the Psi prefences.

_UPD_: *jabber.ru* is now also running a stun server: *stun.jabber.ru* port: *5249*.

<br><br>

{{psiplus_account_props.png<br>

= Troubleshooting Voice Calls with Psi/Psi+ =

First step, install the latest version of Psi/Psi+

Psi 0.14 has several known interoperability issues with voice calls. To get voice calls to work stable, it is essential to be using a recent version of Psi/Psi+.

Second step, make sure your system is reachable over IPv6

Many systems cannot be reached over IPv4, which means a direct connection is impossible. The easiest solution to this problem is enabling IPv6 support. Even when your internet service provider does not offer IPv6 connectivity, you can use tunneling to obtain IPv6 support. If you can access this website, IPv6 is working correctly and you can go to the next step. Look at the instructions below to obtain IPv6 connectivity.

Enable IPv6 connectivity

On older systems, such as MS Windows XP, IPv6 connectivity is not enabled by default. On MS Windows XP, the following command enables IPv6 support:

netsh interface ipv6 install

If your service provider offers native IPv6 support, you may already be able to access the testpage. Otherwise look at the sections below.

Set up an IPv6 tunnel using [[http://en.wikipedia.org/wiki/Teredo_tunneling|Teredo]]

When your service provider does not offer native IPv6 connectivity, you can set up a tunnel over their IPv4 network. On MS Windows XP this is done with the following command:

netsh interface ipv6 set teredo client

On Debian and Ubuntu a tunnel can be set up with this command:

apt-get install miredo

or when you are not root:

sudo apt-get install miredo

Other GNU/Linux distributions should also have the miredo package in their repositories.

Now try the testpage again.

Set up an IPv6 tunnel using Freenet6

When Teredo does not work, you can also use Freenet6 to establish an IPv6 tunnel. Download one of the following for MS Windows:

Install and let the client connect. This should give you IPv6 connectivity. You can check this again using the testpage.

There is also a gw6c available in Debian and Ubuntu.

When both parties can access the testpage it should always be possible to establish a voice call to each other. If this does not work, check your firewall settings.

Final step, test your speakers and microphone

Test your speakers and microphone. On GNU/Linux with ALSA a simple test can be done with this command:

arecord | aplay

On MS Windows, the sound recorder can be used to verify the microphone is working correctly.

For testing in Psi/Psi+, try the (Collabora) echo test from this page.

Note that these tests do not offer IPv6 support yet.

= Frequently Asked Questions =

Why should I use IPv6?

There are also several ways to get IPv4 connectivity to work fully from any situation. One option is to set a STUN server as described in the previous section. These approaches tend to be significantly more fragile however. This writer of this text really recommends both parties to enable IPv6 connectivity in the case of voice calls between two Psi instances. This has shown to give a 100% success rate so far.

Why can't I phone a Nokia N900? Why does Psi/Psi+ only support Speex?

Right now it is not possible to establish a succesful phone call to an N900 user. In the service discovery window, you may see the error “codec mismatch”. The Nokia N900 currently offers the following audio codecs:

Psi+ only supports:

Since they have no codec in common. Direct voice calls will always fail between them. Both phones can however dial to Asterisk and should be able to participate on the same voice conference, in which case Asterisk would take care of the transcoding.

The reason Psimedia only supports these codecs is because it currently does not contain any form of codec negotiation. In the future, codec negotiation will be added to Psimedia using the Farsight library. This will bring support for many common codecs including PCMA and PCMU which will allow phone calls to phones such as the Nokia N900 to work.

What about video phoning?

There is an undocumented environment variable, which enables video call support. This support has not seen much testing however and may not work at all. In case you still want to try it, set *PSI_ENABLE_VIDEO=1* before launching Psi.

*Some notes:*

= Other =

TODO by Justin

What's left to do:

Additional information

Voice call howto bin deps deps