whisperfish / libsignal-service-rs

A Rust version of the libsignal-service-java library for communicating with Signal servers.
https://whisperfish.github.io/libsignal-service-rs/libsignal_service
GNU Affero General Public License v3.0
69 stars 32 forks source link

Draft: Calling support #327

Open rubdos opened 2 months ago

rubdos commented 2 months ago

This PR aims to add all the stuff™ necessary to make calls. Could be a lot, could be nothing at all.

rubdos commented 1 month ago

Rebased up to right before reqwest.

rubdos commented 1 month ago

Already outdated. https://github.com/signalapp/Signal-Server/commit/cacd4afbbba4fdd412de8118e00dce17477c78d2

rubdos commented 1 month ago

Already outdated. signalapp/Signal-Server@cacd4af

Now we're ahead of Signal Android and Signal iOS :sweat_smile:

rubdos commented 2 weeks ago

Tested, both end points work.

v1:

TurnServerInfo {
  username: "XXX",
  password: "YYY",
  hostname: Some("turn3.voip.signal.org"),
  urls: ["turn:turn3.voip.signal.org"],
  urls_with_ips: ["turn:34.1.15.80", "turn:34.1.15.80:80?transport=tcp", "turns:34.1.15.80:443?transport=tcp", "turn:35.214.194.0", "turn:35.214.194.0:80?transport=tcp", "turns:35.214.194.0:443?transport=tcp", "turn:[2600:1901:8120:e0:0:1d:0:0]", "turn:[2600:1901:8120:e0:0:1d:0:0]:80?transport=tcp", "turns:[2600:1901:8120:e0:0:1d:0:0]:443?transport=tcp", "turn:[2600:1900:4060:4603:0:24:0:0]", "turn:[2600:1900:4060:4603:0:24:0:0]:80?transport=tcp", "turns:[2600:1900:4060:4603:0:24:0:0]:443?transport=tcp"] }

v2:

[
  TurnServerInfo {
    username: "AAAA",
    password: "BBBB",
    hostname: Some("turn3.voip.signal.org"),
    urls: ["turn:turn3.voip.signal.org"],
    urls_with_ips: ["turn:34.1.15.80", "turn:34.1.15.80:80?transport=tcp", "turns:34.1.15.80:443?transport=tcp", "turn:35.214.194.0", "turn:35.214.194.0:80?transport=tcp", "turns:35.214.194.0:443?transport=tcp", "turn:[2600:1901:8120:e0:0:1c:0:0]", "turn:[2600:1901:8120:e0:0:1c:0:0]:80?transport=tcp", "turns:[2600:1901:8120:e0:0:1c:0:0]:443?transport=tcp", "turn:[2600:1900:4060:4603:0:24:0:0]", "turn:[2600:1900:4060:4603:0:24:0:0]:80?transport=tcp", "turns:[2600:1900:4060:4603:0:24:0:0]:443?transport=tcp"]
  }
]

Things to note: username and password seem to follow a pattern. Both were distinct, so I suppose they're generated on the fly. Username seems like a versioned unix timestamp with some other number behind it (unixts:other-number:#01), and the password looks like a base64 encoded string. These things can probably be inferred from the server source code. :-)

The IP addresses mentioned in the answers are what you get by resolving the turn3.voip.signal.org DNS name.

rubdos commented 2 weeks ago

Already outdated. signalapp/Signal-Server@cacd4af

Android moved on: https://github.com/signalapp/Signal-Android/commit/47300bbd563