<commit_before>.. _faq:

%%%%%%%%%%%
Kurento FAQ
%%%%%%%%%%%

This is a list of Frequently Asked Questions about Kurento. Feel free to suggest
new entries or different wording for answers!

How do I...
===========

...install Kurento Media Server in an Amazon EC2 instance?
----------------------------------------------------------

   Though for most situations it's enough to configure a STUN server in the KMS
   configuration files, you might need to install a :term:`TURN` server, for example
   `coturn <https://code.google.com/p/coturn/>`__. Here are some instructions
   on how to install this TURN server for Kurento:

   1. Download the package from the
   `project's page <https://code.google.com/p/coturn/wiki/Downloads>`__.

   2. Extract the contents. You should have a ``INSTALL`` file with
   instructions, and a ``.deb`` package. Follow the instructions to install the
   package.

   3. Once the package is installed, you'll need to modify the startup script
   in ``/etc/init.d/coturn``.

      - Add the external and local IPs as vars::

            EXTERNAL_IP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
            LOCAL_IP=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)

      - Modify the DAEMON_ARGS var to take these IPs into account, along
        with the long-term credentials user and password (``<PASSWORD>`` in
        this case, but could be different), realm and some other options::

             DAEMON_ARGS="-c /etc/turnserver.conf -f -o -a -v -r kurento.org
             -u kurento:kurento --no-stdout-log --external-ip $EXTERNAL_IP/$LOCAL_IP"

   4. Then let's enable the turnserver to run as an automatic service daemon. For this,
   open the file ``/etc/default/coturn`` and uncomment the key::

      TURNSERVER_ENABLED=1

   5. Now, you have to tell the Kurento server where is the turnserver
   installed. For this, modify the turnURL key in ``/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini``::

      turnURL=kurento:kurento@<public-ip>:3478

   The following ports should be open in the firewall:

      - 3478 TCP & UDP

      - 49152 - 65535 UDP: As per `RFC 5766 <http://tools.ietf.org/html/rfc5766>`__, these are the ports that the
        TURN server will use to exchange media. These ports can be changed
        using the ``--max-port`` and ``--min-port`` options from the turnserver.<commit_msg>Configure stun correctly on EC2 installation<commit_after>.. _faq:

%%%%%%%%%%%
Kurento FAQ
%%%%%%%%%%%

This is a list of Frequently Asked Questions about Kurento. Feel free to suggest
new entries or different wording for answers!

How do I...
===========

...install Kurento Media Server in an Amazon EC2 instance?
----------------------------------------------------------

   Though for most situations it's enough to configure a STUN server in the KMS
   configuration files, you might need to install a :term:`TURN` server, for example
   `coturn <https://code.google.com/p/coturn/>`__. Here are some instructions
   on how to install this TURN server for Kurento:

   1. Download the package from the
   `project's page <https://code.google.com/p/coturn/wiki/Downloads>`__.

   2. Extract the contents. You should have a ``INSTALL`` file with
   instructions, and a ``.deb`` package. Follow the instructions to install the
   package.

   3. Once the package is installed, you'll need to modify the startup script
   in ``/etc/init.d/coturn``.

      - Add the external and local IPs as vars::

            EXTERNAL_IP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
            LOCAL_IP=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)

      - Modify the DAEMON_ARGS var to take these IPs into account, along
        with the long-term credentials user and password (``<PASSWORD>:<PASSWORD>`` in
        this case, but could be different), realm and some other options::

             DAEMON_ARGS="-c /etc/turnserver.conf -f -o -a -v -r kurento.org
             -u kurento:kurento --no-stdout-log --external-ip $EXTERNAL_IP/$LOCAL_IP"

   4. Then let's enable the turnserver to run as an automatic service daemon. For this,
   open the file ``/etc/default/coturn`` and uncomment the key::

      TURNSERVER_ENABLED=1

   5. Now, you have to tell the Kurento server where is the turnserver
   installed. For this, modify the turnURL key in ``/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini``::

      turnURL=kurento:kurento@<public-ip>:3478
      stunServerAddress=<public-ip>
      stunServerPort=3478

   The following ports should be open in the firewall:

      - 3478 TCP & UDP

      - 49152 - 65535 UDP: As per `RFC 5766 <http://tools.ietf.org/html/rfc5766>`__, these are the ports that the
        TURN server will use to exchange media. These ports can be changed
        using the ``--max-port`` and ``--min-port`` options from the turnserver.
{'fraction_non_alphanumeric': 0.1304883052933935, 'fraction_numerical': 0.025235945835043086, 'mean_word_length': 2.7528868360277134, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1403253', 'n_tokens_mistral': 1561, 'n_tokens_neox': 1426, 'n_words': 556}