Skip to content
Snippets Groups Projects
Commit 8aa10d75 authored by Amin Bandali's avatar Amin Bandali
Browse files

Add misc page for temporarily linking to older wiki pages

This page mainly serves as a jump-in point for the pages of an earlier
version of these documents previously in form of a GitLab wiki.
The ultimate goal/plan for the following pages is to rewrite and/or
reorganize them into the three manuals of Jami: the user manual, the
build manual, and the developer manual.  Thus, the pages linked to
from this page may be moved at any given time.

Change-Id: Iaa4c6ca8cc676a76daa6c3cb30d7772b5ed1a5fc
parent b26be7a9
No related branches found
No related tags found
No related merge requests found
Showing
with 195 additions and 83 deletions
Displayed status
================
Every client generally must be able to show what peer read what message and get how many unread messages there is. Every client generally must be able to show what peer read what message and get how many unread messages there is.
For this, the daemon provides some APIs: For this, the daemon provides some APIs:
# Set a message displayed ## Set a message displayed
The Configuration manager provides: The Configuration manager provides:
...@@ -62,12 +65,12 @@ getDisplayed(const std::string& conversationId, const std::string& messageId) ...@@ -62,12 +65,12 @@ getDisplayed(const std::string& conversationId, const std::string& messageId)
Then the peer will know this via `onMessageDisplayed` and emit a signal to the client (`DRing::ConfigurationSignal::AccountMessageStatusChanged` with status 3 (`DRing::Account::MessageStates::DISPLAYED`)) Then the peer will know this via `onMessageDisplayed` and emit a signal to the client (`DRing::ConfigurationSignal::AccountMessageStatusChanged` with status 3 (`DRing::Account::MessageStates::DISPLAYED`))
# Get unread messages ## Get unread messages
By knowing the lastDisplayedMessage for our account, we can use this informations and `ConfigrationManager::countInteractionsSince` which count interaction since last message to a given message (typically last displayed interaction) By knowing the lastDisplayedMessage for our account, we can use this informations and `ConfigrationManager::countInteractionsSince` which count interaction since last message to a given message (typically last displayed interaction)
To get last displayed message for a member, in `Configuration::getConversationMembers` each member will have the last displayed interaction available via `memberInfo["lastDisplayed"]` To get last displayed message for a member, in `Configuration::getConversationMembers` each member will have the last displayed interaction available via `memberInfo["lastDisplayed"]`
# How this information is stored ## How this information is stored
In `src/jamidht/conversation.cpp` each conversation store the last displayed messages in a map<string, string> (uri, interactionId) and this structure is serialized in `fileutils::get_data_dir()/getAccountID()/conversation_data/repository_->id()/lastDisplayed` In `src/jamidht/conversation.cpp` each conversation store the last displayed messages in a map<string, string> (uri, interactionId) and this structure is serialized in `fileutils::get_data_dir()/getAccountID()/conversation_data/repository_->id()/lastDisplayed`
Choosing CRF value for encoder
==============================
## Context ## Context
Bandwidth usage by the Jami application is not optimal for all types of connections. Indeed, in some cases, the user experience is not good (satellite connection, ...) despite the bandwidth management algorithm. Bandwidth usage by the Jami application is not optimal for all types of connections. Indeed, in some cases, the user experience is not good (satellite connection, ...) despite the bandwidth management algorithm.
......
All features by client
======================
Legend: Legend:
- ✓ : available - ✓ : available
- X : not available yet - X : not available yet
- N/A : not applicable for this client - N/A : not applicable for this client
# Text messaging ## Text messaging
| **Client** | Linux | Windows | Android | Android TV | iOS | macOS | | **Client** | Linux | Windows | Android | Android TV | iOS | macOS |
| ---------------------------------- | :---: | :-----: | :-----: | :--------: | :-: | :---: | | ---------------------------------- | :---: | :-----: | :-----: | :--------: | :-: | :---: |
...@@ -18,7 +21,7 @@ Legend: ...@@ -18,7 +21,7 @@ Legend:
| Typing indicator | ✓ | ✓ | ✓ | X | ✓ | X | | Typing indicator | ✓ | ✓ | ✓ | X | ✓ | X |
| Read status | X | X | X | X | X | X | | Read status | X | X | X | X | X | X |
# Calling ## Calling
| **Client** | Linux | Windows | Android | Android TV | iOS | macOS | | **Client** | Linux | Windows | Android | Android TV | iOS | macOS |
| --------------------------- | :---: | :-----: | :-----: | :--------: | :-: | :---: | | --------------------------- | :---: | :-----: | :-----: | :--------: | :-: | :---: |
...@@ -48,7 +51,7 @@ Legend: ...@@ -48,7 +51,7 @@ Legend:
(1) only on X (not Wayland) (1) only on X (not Wayland)
# Account settings ## Account settings
| **Client** | Linux | Windows | Android | Android TV | iOS | macOS | | **Client** | Linux | Windows | Android | Android TV | iOS | macOS |
| --------------------------- | :---: | :-----: | :-----: | :--------: | :-: | :---: | | --------------------------- | :---: | :-----: | :-----: | :--------: | :-: | :---: |
...@@ -64,7 +67,7 @@ Legend: ...@@ -64,7 +67,7 @@ Legend:
| Auto answer | ✓ | ✓ | ✓ | ✓ | X | ✓ | | Auto answer | ✓ | ✓ | ✓ | ✓ | X | ✓ |
| Custom ringtones | ✓ | ✓ | ✓ | X | X | ✓ | | Custom ringtones | ✓ | ✓ | ✓ | X | X | ✓ |
# Other features ## Other features
| **Client** | Linux | Windows | Android | Android TV | iOS | macOS | | **Client** | Linux | Windows | Android | Android TV | iOS | macOS |
| ------------------------------ | :---: | :-----: | :-----: | :--------: | :-: | :---: | | ------------------------------ | :---: | :-----: | :-----: | :--------: | :-: | :---: |
...@@ -81,7 +84,7 @@ Legend: ...@@ -81,7 +84,7 @@ Legend:
| JAMS support | ✓ | ✓ | ✓ | X | ✓ | ✓ | | JAMS support | ✓ | ✓ | ✓ | X | ✓ | ✓ |
| Plugin support | ✓ | ✓ | ✓ | ✓ | X | ✓ | | Plugin support | ✓ | ✓ | ✓ | ✓ | X | ✓ |
# Advanced settings ## Advanced settings
| **Client** | Linux | Windows | Android | Android TV | iOS | macOS | | **Client** | Linux | Windows | Android | Android TV | iOS | macOS |
| ------------------ | :---: | :-----: | :-----: | :--------: | :-: | :---: | | ------------------ | :---: | :-----: | :-----: | :--------: | :-: | :---: |
......
Banned contact
==============
Following information are here for development purposes and may not Following information are here for development purposes and may not
reflect the current state of any Ring client. reflect the current state of any Ring client.
......
Coding rules
============
**This page gives rules and/or guidances to all **This page gives rules and/or guidances to all
developers that want to integrate some code to Jami ** developers that want to integrate some code to Jami **
C++ format rules are defined by this clang-format file: C++ format rules are defined by this clang-format file:
https://git.jami.net/savoirfairelinux/ring-daemon/blob/master/.clang-format https://git.jami.net/savoirfairelinux/jami-daemon/blob/master/.clang-format
All developers are recommended to format their code using the script in `jami-project/scripts/format.sh`. All developers are recommended to format their code using the script in `jami-project/scripts/format.sh`.
This is done automatically (as a pre-commit hook) when using `./make-ring.py --init` This is done automatically (as a pre-commit hook) when using `./build.py --init`
\ No newline at end of file
Libringclient coding rules
==========================
**This page gives rules and/or guidances to all **This page gives rules and/or guidances to all
developers that want to integrate some code to the LibRingClient (a developers that want to integrate some code to the LibRingClient (a
Daemon Middleware for Desktop Clients).** Daemon Middleware for Desktop Clients).**
......
# Qt/c++ Qt and QML coding guidelines
## Signal and slot naming ============================
## Qt/c++
### Signal and slot naming
Both signals and slots should use camelCase. Both signals and slots should use camelCase.
A signal should use the simple past tense or past participle of some verb, likely prefixed by a short subject. A corresponding slot should be the signal prefixed with the word "on" and not the word "slot". Here are some examples: A signal should use the simple past tense or past participle of some verb, likely prefixed by a short subject. A corresponding slot should be the signal prefixed with the word "on" and not the word "slot". Here are some examples:
```c ```c
...@@ -23,8 +26,8 @@ slot: ...@@ -23,8 +26,8 @@ slot:
``` ```
--- ---
# QML ## QML
# Code formatting ## Code formatting
The Qt 5.15.0 version of qmlformat has some issues dealing with comment sections and currently does not discriminate against max columns, so we will continue to format using these guidelines for now. The Qt 5.15.0 version of qmlformat has some issues dealing with comment sections and currently does not discriminate against max columns, so we will continue to format using these guidelines for now.
The following is a comprehensive sample component, adapted from https://doc.qt.io/qt-5/qml-codingconventions.html, that attempts to illustrate the ideally formatted component. The following is a comprehensive sample component, adapted from https://doc.qt.io/qt-5/qml-codingconventions.html, that attempts to illustrate the ideally formatted component.
```javascript ```javascript
......
# C++ Qt and QML testing tools
========================
## Google Test ## C++
### Google Test
Google's c++ test framework. Google's c++ test framework.
### Installation #### Installation
- Ubuntu / Debian: - Ubuntu / Debian:
`apt install googletest libgtest-dev` `apt install googletest libgtest-dev`
## Example main.cpp ### Example main.cpp
``` ```
#include <gtest/gtest.h> #include <gtest/gtest.h>
...@@ -26,11 +29,11 @@ int main(int argc, char *argv[]) ...@@ -26,11 +29,11 @@ int main(int argc, char *argv[])
} }
``` ```
# QML ## QML
## QtQuickTest ### QtQuickTest
### Installation #### Installation
- Ubuntu / Debian: `apt install qml-module-qqtest libqt5quicktest5` - Ubuntu / Debian: `apt install qml-module-qqtest libqt5quicktest5`
- Example main.cpp - Example main.cpp
......
UI and UX development
=====================
The purpose of this page is to act as a reference during UI/UX development and to help synchronize the various Ring clients. The purpose of this page is to act as a reference during UI/UX development and to help synchronize the various Ring clients.
As a start, we should post screenshots from all important Ring views. As a start, we should post screenshots from all important Ring views.
# Screenshots ## Screenshots
**Disclaimer: This page is not up-to-date!** **Disclaimer: This page is not up-to-date!**
...@@ -18,6 +21,6 @@ Link device (explanatory) | ![Account-link-device-1](/uploads/42aa54246a264a908 ...@@ -18,6 +21,6 @@ Link device (explanatory) | ![Account-link-device-1](/uploads/42aa54246a264a908
Link device (pin + password) | ![Account-link-device-2](/uploads/91f11432cb8e63e717b8460bc05d63a3/Account-link-device-2.png) | TODO | ![Account-link-device-2-win32](/uploads/3d659afe96b24dc222d8f88f5e616811/Account-link-device-2-win32.png) | TODO | TODO Link device (pin + password) | ![Account-link-device-2](/uploads/91f11432cb8e63e717b8460bc05d63a3/Account-link-device-2.png) | TODO | ![Account-link-device-2-win32](/uploads/3d659afe96b24dc222d8f88f5e616811/Account-link-device-2-win32.png) | TODO | TODO
Chat | ![Ring_gnome_chat_view](/uploads/fe6dac09b551f2922991fe956fae0bb5/Ring_gnome_chat_view.png) | TODO | TODO | TODO | TODO Chat | ![Ring_gnome_chat_view](/uploads/fe6dac09b551f2922991fe956fae0bb5/Ring_gnome_chat_view.png) | TODO | TODO | TODO | TODO
# Future ## Future
[Ring_GNOME_client_mock-ups.pdf](/uploads/698997f2126004a2e82b3d6e32bcdae4/Ring_GNOME_client_mock-ups.pdf) [Ring_GNOME_client_mock-ups.pdf](/uploads/698997f2126004a2e82b3d6e32bcdae4/Ring_GNOME_client_mock-ups.pdf)
...@@ -24,3 +24,5 @@ This documentation is community-driven and :ref:`anyone can contribute ...@@ -24,3 +24,5 @@ This documentation is community-driven and :ref:`anyone can contribute
user/index user/index
build/index build/index
technical/index technical/index
contribute
misc
misc.rst 0 → 100644
Miscellaneous
=============
This page mainly serves as a jump-in point for the pages of an earlier
version of these documents previously in form of a GitLab wiki.
The ultimate goal/plan for the following pages is to rewrite and/or
reorganize them into the three manuals of Jami: the :doc:`user manual
<user/index>`, the :doc:`build manual <build/index>`, and the
:doc:`developer manual <developer/index>`. Thus, the following links
may change at any time.
.. toctree::
:maxdepth: 1
features/All-features-by-client
guidelines/Banned-Contact
guidelines/Coding-rules
guidelines/Identifiers
guidelines/Libringclient-Coding-Rules
guidelines/Qt-and-QML-coding-guidelines
guidelines/Qt-and-QML-testing-tools
guidelines/UI-and-UX-development
others/gsoc
technical/0.-Introduction
technical/1.-The-different-APIs
technical/2.1.-Manage-Accounts
technical/2.2.-Manage-contacts
technical/swarm
technical/2.4.-Let's-do-a-call
technical/2.5.-File-transfer
2.6-Displayed-status
technical/3.6-Setup-your-own-TURN-server
technical/3.8-Sync-profiles
technical/4.2.-Submit-your-first-patch
technical/4.3.-Features-requests
technical/5.2.-The-connection-manager
technical/5.5-Call-in-Swarms
technical/6.1.-Conference-Protocol
technical/6.2.-Sync-Protocol
technical/7.-Jami-plugins
technical/7.1---Create-Plugin
technical/7.2---Tensorflow-Plugin
technical/Important-RFCs
technical/Improving-Jami's-quality
technical/LRC-documentation
technical/Name-Server-Protocol
technical/Protocol
technical/Release-process
technical/Technical-overview
Choosing-CRF-value-for-encoder
tutorials/Jami-distributed-network
tutorials/Réseau-distribué-Jami
tutorials/Questions-récurrentes
tutorials/Rapporter-un-bug
tutorials/Working-with-gerrit
tutorials/Utiliser-gerrit
user-manual/introduction
user-manual/installation
user-manual/create-jami-account
GSoC
====
The Ring project has previously participated in the Google Summer of The Ring project has previously participated in the Google Summer of
Code program on 2016 and 2017 under the umbrella of the [Debian Code program on 2016 and 2017 under the umbrella of the [Debian
project](https://www.debian.org/) and the [GNU project](https://www.debian.org/) and the [GNU
......
# Table of contents Introduction
============
## Table of contents
Greetings people. In this part of the documentation, you will learn how Jami works from the high level, to the bottom, with some examples. The following part will follow this plan: Greetings people. In this part of the documentation, you will learn how Jami works from the high level, to the bottom, with some examples. The following part will follow this plan:
1. [The different APIs](1. The different APIs) 1. [The different APIs](1. The different APIs)
...@@ -35,7 +38,7 @@ Greetings people. In this part of the documentation, you will learn how Jami wor ...@@ -35,7 +38,7 @@ Greetings people. In this part of the documentation, you will learn how Jami wor
1. [Conference Protocol](6.1. Conference Protocol) 1. [Conference Protocol](6.1. Conference Protocol)
2. [Sync Protocol](6.2. Sync Protocol) 2. [Sync Protocol](6.2. Sync Protocol)
# Description ## Description
If you read this, you probably want to either contribute to one of the projects or to implement your own client. There is three main layers in this project: If you read this, you probably want to either contribute to one of the projects or to implement your own client. There is three main layers in this project:
......
# OpenDHT The different APIs
==================
## OpenDHT
The documentation related to the API of OpenDHT is [here](https://github.com/savoirfairelinux/opendht/wiki/API-Overview) and will not be detailed in the following part. The documentation related to the API of OpenDHT is [here](https://github.com/savoirfairelinux/opendht/wiki/API-Overview) and will not be detailed in the following part.
# Daemon ## Daemon
## The managers ### The managers
The API of the daemon is decomposed between 5 Managers + 1 Instance file: The API of the daemon is decomposed between 5 Managers + 1 Instance file:
+ The **CallManager** interface is used to manage call and conference related actions. Since Ring-daemon supports multiple incoming/outgoing calls, any actions involving a specific call must address the method by the means of a unique callID. Ring-daemon will generate a unique callID for outgoing and incoming calls. + The **CallManager** interface is used to manage call and conference related actions. Since Ring-daemon supports multiple incoming/outgoing calls, any actions involving a specific call must address the method by the means of a unique callID. Ring-daemon will generate a unique callID for outgoing and incoming calls.
...@@ -13,7 +16,7 @@ The API of the daemon is decomposed between 5 Managers + 1 Instance file: ...@@ -13,7 +16,7 @@ The API of the daemon is decomposed between 5 Managers + 1 Instance file:
+ The **VideoManager** used to manage video devices and renderers + The **VideoManager** used to manage video devices and renderers
+ The **Instance** is used to count the number of clients actually registered to the core. When initializing your client, you need to register it against the core by using this interface. + The **Instance** is used to count the number of clients actually registered to the core. When initializing your client, you need to register it against the core by using this interface.
## DBUS ### DBUS
All the documentation and code for the dbus API is located in `ring-daemon/bin/dbus`. All the documentation and code for the dbus API is located in `ring-daemon/bin/dbus`.
...@@ -21,11 +24,11 @@ If you use linux, you can use `d-feet` when the daemon is running to manipulate ...@@ -21,11 +24,11 @@ If you use linux, you can use `d-feet` when the daemon is running to manipulate
The LRC project uses this API (and use libwrap on windows and mac os). The LRC project uses this API (and use libwrap on windows and mac os).
## JNI ### JNI
All the documentation and code for the JNI API is located in `ring-daemon/bin/jni`. All the documentation and code for the JNI API is located in `ring-daemon/bin/jni`.
### Generation process #### Generation process
- `cd ring-project/` - `cd ring-project/`
- Check `./daemon/src/dring` - Check `./daemon/src/dring`
...@@ -42,15 +45,15 @@ All the documentation and code for the JNI API is located in `ring-daemon/bin/jn ...@@ -42,15 +45,15 @@ All the documentation and code for the JNI API is located in `ring-daemon/bin/jn
- `./make-ring.py --init --distribution=Android` - `./make-ring.py --init --distribution=Android`
- `./make-ring.py --install --distribution=Android` - `./make-ring.py --install --distribution=Android`
## node js ### node js
All the documentation and code for the Node JS API is located in `ring-daemon/bin/nodejs`. This API is not used in any known project and maybe is not up-to-date. All the documentation and code for the Node JS API is located in `ring-daemon/bin/nodejs`. This API is not used in any known project and maybe is not up-to-date.
## REST ### REST
All the documentation and code for the REST API is located in `ring-daemon/bin/restcpp`. This API is not used in any known project and maybe is not up-to-date. All the documentation and code for the REST API is located in `ring-daemon/bin/restcpp`. This API is not used in any known project and maybe is not up-to-date.
## Python wrapper ### Python wrapper
A Python wrapper is available in `ring-daemon/tools/dringctrl`. This wrapper uses d-bus. A Python wrapper is available in `ring-daemon/tools/dringctrl`. This wrapper uses d-bus.
...@@ -237,13 +240,13 @@ if __name__ == '__main__': ...@@ -237,13 +240,13 @@ if __name__ == '__main__':
irc_controler.run() irc_controler.run()
``` ```
# LRC ## LRC
## Doxygen doc ### Doxygen doc
The Doxygen documentation is available [here](https://jenkins.ring.cx/view/libringclient/job/libringclient-doxygen/doxygen/annotated.html) and currently generated by Jenkins each week. The Doxygen documentation is available [here](https://jenkins.ring.cx/view/libringclient/job/libringclient-doxygen/doxygen/annotated.html) and currently generated by Jenkins each week.
## Database schema ### Database schema
![lrcbd](/uploads/94bee0c65b2a87b0f3e1ee223ccf81dc/lrcbd.jpg) ![lrcbd](/uploads/94bee0c65b2a87b0f3e1ee223ccf81dc/lrcbd.jpg)
......
Manage accounts
===============
In this part, we will learn how to manage a Ring account. This means, how to create a Ring account, modify the basic settings and delete the account. This part will *NOT* explain what all the settings mean or how we can use the account to do any action like adding a contact. In this part, we will learn how to manage a Ring account. This means, how to create a Ring account, modify the basic settings and delete the account. This part will *NOT* explain what all the settings mean or how we can use the account to do any action like adding a contact.
# Create a new account ## Create a new account
## Client side ### Client side
### Gnome #### Gnome
The code related to this feature is located in `src/accountcreationwizard.*` The code related to this feature is located in `src/accountcreationwizard.*`
### LRC #### LRC
The account creation is mainly managed by the *NewAccountModel* in `src/api/newaccountmodel.h` and `src/newaccountmodel.cpp` The account creation is mainly managed by the *NewAccountModel* in `src/api/newaccountmodel.h` and `src/newaccountmodel.cpp`
## Daemon side ### Daemon side
### API #### API
In cx.ring.Ring.ConfigurationManager: In cx.ring.Ring.ConfigurationManager:
...@@ -68,11 +71,11 @@ NewAccountModel::createNewAccount(profile::Type type, ...@@ -68,11 +71,11 @@ NewAccountModel::createNewAccount(profile::Type type,
When a new account is added, the signal `accountsChanged` will be emitted. The client should update its internal structure after this signal with other methods in ConfigurationManager. When a new account is added, the signal `accountsChanged` will be emitted. The client should update its internal structure after this signal with other methods in ConfigurationManager.
### Core #### Core
The main logic to create a new account is located in `src/ringdht/ringaccount.cpp`, in `RingAccount::createAccount` The main logic to create a new account is located in `src/ringdht/ringaccount.cpp`, in `RingAccount::createAccount`
## How it works, from scratch ### How it works, from scratch
A Ring account is in fact represented by some files stored in a gzip archive. If a password is provided during the account creation, the archive will be encrypted as following: `dht::crypto::aesEncrypt(archive, password)` (`dht::crypto::aesEncrypt` is defined in OpenDHT and use `nettle/{aes,gcm}`). This is what the archive will contain a big JSON file with: A Ring account is in fact represented by some files stored in a gzip archive. If a password is provided during the account creation, the archive will be encrypted as following: `dht::crypto::aesEncrypt(archive, password)` (`dht::crypto::aesEncrypt` is defined in OpenDHT and use `nettle/{aes,gcm}`). This is what the archive will contain a big JSON file with:
...@@ -89,23 +92,23 @@ So let's generate it! ...@@ -89,23 +92,23 @@ So let's generate it!
# Delete the account ## Delete the account
Deleting a Ring account is pretty simple. Because the keys are only on the device, if the keys are deleted... the account is deleted! The only thing outside the device is the username, on the nameserver. To remove this info, it depends how the nameserver work. For example, it's not possible with https://ns.ring.cx Deleting a Ring account is pretty simple. Because the keys are only on the device, if the keys are deleted... the account is deleted! The only thing outside the device is the username, on the nameserver. To remove this info, it depends how the nameserver work. For example, it's not possible with https://ns.ring.cx
## Client side ### Client side
### Gnome #### Gnome
The code related to this feature is located in `newaccountsettingsview.cpp` The code related to this feature is located in `newaccountsettingsview.cpp`
### LRC #### LRC
The account deletion is in the *NewAccountModel* in `src/api/newaccountmodel.h` and `src/newaccountmodel.cpp` (`removeAccount`) The account deletion is in the *NewAccountModel* in `src/api/newaccountmodel.h` and `src/newaccountmodel.cpp` (`removeAccount`)
## Daemon side ### Daemon side
### API #### API
In cx.ring.Ring.ConfigurationManager: In cx.ring.Ring.ConfigurationManager:
...@@ -124,14 +127,14 @@ In cx.ring.Ring.ConfigurationManager: ...@@ -124,14 +127,14 @@ In cx.ring.Ring.ConfigurationManager:
When the account is deleted, the signal `accountsChanged` will be emitted. The client should update its internal structure after this signal with other methods in ConfigurationManager. When the account is deleted, the signal `accountsChanged` will be emitted. The client should update its internal structure after this signal with other methods in ConfigurationManager.
### Core #### Core
The main logic to create a new account is located in `src/manager.cpp`, in `Manager::removeAccount`. It removes the accounts files and update the config (`dring.yml`). The main logic to create a new account is located in `src/manager.cpp`, in `Manager::removeAccount`. It removes the accounts files and update the config (`dring.yml`).
# Update the settings ## Update the settings
**TODO** **TODO**
# Add and revoke devices ## Add and revoke devices
**TODO** **TODO**
Manage contacts
===============
This section will present how to find and add a contact from the DHT to the client. The usage of a name server will not be explained here. If you want details about that, please read: https://git.ring.cx/savoirfairelinux/ring-project/wikis/technical/Name-Server-Protocol This section will present how to find and add a contact from the DHT to the client. The usage of a name server will not be explained here. If you want details about that, please read: https://git.ring.cx/savoirfairelinux/ring-project/wikis/technical/Name-Server-Protocol
# Presence on the network ## Presence on the network
## Announce the presence on the DHT ### Announce the presence on the DHT
The presence is pretty simple to announce on the DHT. In fact, it's just a value containing the device hash (see [previous section](https://git.ring.cx/savoirfairelinux/ring-project/wikis/technical/2.1.-Manage-Accounts)) on the hash corresponding to the fingerprint of the key. So, if we have the account `bf5f1e21d3eb2c1246946aa49d5dcf3e5b9cb1b9` with the device `62fbdff0ce86f368c7d3c2682539e5ba9e06404f`, the following defined value will be sent over the DHT: The presence is pretty simple to announce on the DHT. In fact, it's just a value containing the device hash (see [previous section](https://git.ring.cx/savoirfairelinux/ring-project/wikis/technical/2.1.-Manage-Accounts)) on the hash corresponding to the fingerprint of the key. So, if we have the account `bf5f1e21d3eb2c1246946aa49d5dcf3e5b9cb1b9` with the device `62fbdff0ce86f368c7d3c2682539e5ba9e06404f`, the following defined value will be sent over the DHT:
...@@ -25,7 +28,7 @@ public: ...@@ -25,7 +28,7 @@ public:
(This value can be put with `dht_.put(h, VALUE, dht::DoneCallback{}, {}, true);`, as a permanent put). If the device is announced, the device is present. For now, there is no way to delete or edit a value on the DHT (this will come when OpenDHT will supports ECC). So, the presence always have a delay for now (mean delay: expire-time/2, so 2min30 for now). (This value can be put with `dht_.put(h, VALUE, dht::DoneCallback{}, {}, true);`, as a permanent put). If the device is announced, the device is present. For now, there is no way to delete or edit a value on the DHT (this will come when OpenDHT will supports ECC). So, the presence always have a delay for now (mean delay: expire-time/2, so 2min30 for now).
## Get if a contact is present ### Get if a contact is present
Now our presence on the network, it's time to get if somebody is present on the DHT. With the previous section, it's easy to do the reverse process. To know if somebody is present on the DHT (ex: `bf5f1e21d3eb2c1246946aa49d5dcf3e5b9cb1b9`), we have to get value at `bf5f1e21d3eb2c1246946aa49d5dcf3e5b9cb1b9` and retrieve the `DeviceAnnouncement` on this hash. The related code in the ring daemon is in `ringaccount.cpp`: Now our presence on the network, it's time to get if somebody is present on the DHT. With the previous section, it's easy to do the reverse process. To know if somebody is present on the DHT (ex: `bf5f1e21d3eb2c1246946aa49d5dcf3e5b9cb1b9`), we have to get value at `bf5f1e21d3eb2c1246946aa49d5dcf3e5b9cb1b9` and retrieve the `DeviceAnnouncement` on this hash. The related code in the ring daemon is in `ringaccount.cpp`:
...@@ -62,9 +65,9 @@ dht_.get<DeviceAnnouncement>(to, [shared,to,treatedDevices,op](DeviceAnnouncemen ...@@ -62,9 +65,9 @@ dht_.get<DeviceAnnouncement>(to, [shared,to,treatedDevices,op](DeviceAnnouncemen
And that's all. And that's all.
# Pending request ## Pending request
## Send a request ### Send a request
**TODO craft request** **TODO craft request**
...@@ -75,13 +78,13 @@ The following code is used in the daemon: ...@@ -75,13 +78,13 @@ The following code is used in the daemon:
dht_.putEncrypted(dht::InfoHash::get("inbox:"+dev.toString()), dev, dht::TrustRequest(DHT_TYPE_NS, payload)); dht_.putEncrypted(dht::InfoHash::get("inbox:"+dev.toString()), dev, dht::TrustRequest(DHT_TYPE_NS, payload));
``` ```
## Receiving a request ### Receiving a request
**TODO** **TODO**
(Accept/Block/Discard) (Accept/Block/Discard)
# Daemon API ## Daemon API
All methods to follow the presence of a buddy is located in the `PresenceManager` such as: All methods to follow the presence of a buddy is located in the `PresenceManager` such as:
......
Let's do a call
===============
**NOTE: this page detail the principle for Jami accounts. For SIP accounts, the SIP protocol is used.** **NOTE: this page detail the principle for Jami accounts. For SIP accounts, the SIP protocol is used.**
# Daemon side ## Daemon side
When creating a call between two peers, Jami mainly uses known protocols such as ICE, SIP or TLS. However, to make it distributed, the process of creating a call is a bit different. To summarize, when someone wants to contact one of its contact, this is what they will do: When creating a call between two peers, Jami mainly uses known protocols such as ICE, SIP or TLS. However, to make it distributed, the process of creating a call is a bit different. To summarize, when someone wants to contact one of its contact, this is what they will do:
...@@ -12,7 +15,7 @@ When creating a call between two peers, Jami mainly uses known protocols such as ...@@ -12,7 +15,7 @@ When creating a call between two peers, Jami mainly uses known protocols such as
6. The contact is now able to accept or decline the call. When they accept, a ICE transport (UDP only for now) is negotiated to create 4 new sockets for the medias (2 for audio, 2 for video). 6. The contact is now able to accept or decline the call. When they accept, a ICE transport (UDP only for now) is negotiated to create 4 new sockets for the medias (2 for audio, 2 for video).
7. The call is now alive! 7. The call is now alive!
## Exchange ICE candidates ### Exchange ICE candidates
Everything really starts in `jamiaccount.cpp` (`JamiAccount::startOutgoingCall`). Once both ICE objects are ready and when the contact is found via the DHT, the call request for the contact is crafted. This request contains all the informations necessary for the remote ICE session defined by: Everything really starts in `jamiaccount.cpp` (`JamiAccount::startOutgoingCall`). Once both ICE objects are ready and when the contact is found via the DHT, the call request for the contact is crafted. This request contains all the informations necessary for the remote ICE session defined by:
...@@ -44,11 +47,11 @@ and is sent via the DHT in an encrypted message for the device to `hash(callto:x ...@@ -44,11 +47,11 @@ and is sent via the DHT in an encrypted message for the device to `hash(callto:x
The ICE session is created both side when they have all the candidates (so for the sender, when the reply from the contact is received). The ICE session is created both side when they have all the candidates (so for the sender, when the reply from the contact is received).
## ICE negotiation ### ICE negotiation
Pending calls are managed by `JamiAccount::handlePendingCallList()`, which first wait that the TCP negotiation finish (and if it fails, wait for the UDP one). The code for the ICE negotiation is mainly managed by [pjproject](https://github.com/pjsip/pjproject) but for Jami, the interesting part is located in `ice_transport.cpp`. Moreover, we add some important patches/features on top of *pjproject* not merged upstream for now (for example, ICE over TCP). These patches are present in `contrib/src/pjproject`. Pending calls are managed by `JamiAccount::handlePendingCallList()`, which first wait that the TCP negotiation finish (and if it fails, wait for the UDP one). The code for the ICE negotiation is mainly managed by [pjproject](https://github.com/pjsip/pjproject) but for Jami, the interesting part is located in `ice_transport.cpp`. Moreover, we add some important patches/features on top of *pjproject* not merged upstream for now (for example, ICE over TCP). These patches are present in `contrib/src/pjproject`.
## Encrypt the control socket ### Encrypt the control socket
Once the socket is created and managed by an **IceTransport** instance, it is then wrapped in a **SipTransport** corresponding to a *TlsIceTransport*. The main code is located into `JamiAccount::handlePendingCall()` and the wrapping is done into `SipTransportBroker::getTlsIceTransport`. Finally, our session is managed by **TlsSession** in `daemon/src/security/tls_session.cpp` and uses the GnuTLS library. Once the socket is created and managed by an **IceTransport** instance, it is then wrapped in a **SipTransport** corresponding to a *TlsIceTransport*. The main code is located into `JamiAccount::handlePendingCall()` and the wrapping is done into `SipTransportBroker::getTlsIceTransport`. Finally, our session is managed by **TlsSession** in `daemon/src/security/tls_session.cpp` and uses the GnuTLS library.
...@@ -61,15 +64,15 @@ Related articles: ...@@ -61,15 +64,15 @@ Related articles:
+ https://jami.net/improved-video-rotation-support/ + https://jami.net/improved-video-rotation-support/
+ https://jami.net/peer-to-peer-file-sharing-support-in-jami/ + https://jami.net/peer-to-peer-file-sharing-support-in-jami/
## Media sockets ### Media sockets
Media sockets are SRTP sockets where the key is negotiated through the TLS Session previously created. Media sockets are SRTP sockets where the key is negotiated through the TLS Session previously created.
**TODO** **TODO**
## Architecture ### Architecture
# Client APIs ## Client APIs
# LRC ## LRC
\ No newline at end of file
File transfer
=============
**THIS PAGE IS DEPRECATED: READ https://git.jami.net/savoirfairelinux/ring-project/-/wikis/technical/2.3.-Swarm#file-transfer** **THIS PAGE IS DEPRECATED: READ https://git.jami.net/savoirfairelinux/ring-project/-/wikis/technical/2.3.-Swarm#file-transfer**
......
Set up your own TURN server
===========================
Jami can be configured to use TURN or STUN servers ([RFC Jami can be configured to use TURN or STUN servers ([RFC
5766](https://tools.ietf.org/html/rfc5766)) to establish a connection 5766](https://tools.ietf.org/html/rfc5766)) to establish a connection
between two peers. between two peers.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment