This is a guide to set up server-side support for audio/video calls over XMPP. To do this we will first install and configure [coturn](https://github.com/coturn/coturn). It is a libre STUN/TURN server that helps establish peer connections across firewalls for media streams such as calls. Additionally we will configure Prosody to talk to `coturn`.
Like the other guides, this one assumes Debian stable running on the server, the fact that you will end up hosting a few of your friends and that you have some basic skills working on a linux command line.
Furthermore it assumes you have already installed and configured Prosody. If you haven't, take a look at our guide ['Configuring an XMPP server for secure, mobile instant messaging']({filename}instant-messaging/configuring_an_xmpp_server_prosody_0.11.md) first.
no-loopback-peers #dissalow connections on lo interface
no-cli # disable command-line access
Now time for some config. Edit file in a few places:
Add your external IP-address to `listening-ip`. If you don't know it, you can find out using `curl https://ifconfig.co`.
Set `static-auth-secret` to a decently long passphrase. You can also generate one with: `openssl rand -base64 30`. Take note of it because we will need this secret later.
Finally, edit the paths to the Let's Encrypt certificates to whatever you've set in ['Configuring an XMPP server for secure, mobile instant messaging']({filename}instant-messaging/configuring_an_xmpp_server_prosody_0.11.md#enabling-https)
Update & set up Prosody
---
First update your prosody modules:
:::console
apt-get install mercurial
cd /usr/src/prosody-modules
hg pull
hg update
Then edit your prosody config in `/etc/prosody/prosody.cfg.lua`:
First add `turncredentials` to the `modules_enabled` section.
Then, before the 'Virtual Hosts' section add:
:::console
turncredentials_host = "localhost"
turncredentials_secret="mydecentlylongpassphrase"
And replace the value of `turncredentials_secret` with the value of `static-auth-secret` in `/etc/turnserver.conf`