matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

setup element call as an alternative to jitsi

Open BentEngbers opened this issue 1 year ago • 7 comments

Element recently announced that element call is enabled by default in element x and element desktop https://element.io/blog/we-have-lift-off-element-x-call-and-server-suite-are-ready.

There is documentation available about how to setup element call with the latest LTS version of ESS https://ems-docs.element.io/books/element-on-premise-documentation-lts-2404/page/setting-up-element-call.

Maybe we can track progress in this issue?

BentEngbers avatar Oct 01 '24 13:10 BentEngbers

I have created a PR to try and add Element call to the playbook. https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3562

wjbeckett avatar Oct 02 '24 03:10 wjbeckett

@wjbeckett I have not successfully seen media flowing through the livekit instance and I am trying to understand why the PR works you and not me

I tried both element-web and element-call and I see a blank screen in the call window

saket424 avatar Oct 04 '24 12:10 saket424

Failed to get JWT from RTC session's active focus URL of https://sfu-jwt.example.com. Error: SFU Config fetch failed with exception Error: SFU Config fetch failed with status code 500 at sit (openIDSFU.ts:112:11) at async iit (openIDSFU.ts:71:23)

saket424 avatar Oct 04 '24 13:10 saket424

@wjbeckett I am running into this error. Any ideas?

curl 'https://sfu-jwt.example.com/sfu/get' \
  -H 'accept: */*' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'content-type: application/json' \
  -H 'origin: https://call.example.com' \
  -H 'priority: u=1, i' \
  -H 'referer: https://call.example.com/' \
  -H 'sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-site' \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' \
  --data-raw $'{"room":"\u0021LnRtKxZsUjMPQMglJG:example.com","openid_token":{"access_token":"ufGRjCpkiMshdZWBSERZOgCU","expires_in":3600,"matrix_server_name":"example.com","token_type":"Bearer"},"device_id":"IDJBAOGUMV"}'

{"errcode":"M_LOOKUP_FAILED","error":"Failed to look up user info from homeserver"}

saket424 avatar Oct 08 '24 18:10 saket424

@saket424 yes, ita because it's expecting to lookup a user in Matrix Authentication Service (MAS), which isn't implement in this playbook yet. MAS is a requirement of Element Call Sonita can perform user lookups. You'll notice the error in your last comment references openID (openIDSFU.ts:71:23).

wjbeckett avatar Oct 08 '24 19:10 wjbeckett

@wjbeckett If you have a temporary standalone MAS recipe that I can augment with your nearly complete element-call PR, I would be grateful and ready to try it even if it is not fully in ansible

Here is another blog post I cam across related to MAS just as a reference

https://sspaeth.de/2024/08/matrix-server-with-nextcloud-login/

saket424 avatar Oct 09 '24 01:10 saket424

@wjbeckett I've downloaded your version and applied it to my server. I've even seen Update Element Call configuration in config.json and Update Element Call configuration in config.json tasks were succeed. But still, it's sending request to "https://livekit-jwt.call.element.io/sfu/get" when I check network tab on my browser while joining video rooms. I've tried to reset browser cache and disable cloudflare cache but still it is same. I'm getting "Failed to look up user info from homeserver" error, also with Delayed events are not supported on this server (not sure if this one is related) Is there any way to fix it for now?

ilterugur avatar Oct 10 '24 03:10 ilterugur

@wjbeckett If it is any inspiration and I managed to get this element-call livekit element-web talking to element-x working with this project https://github.com/element-hq/element-docker-demo

saket424 avatar Jan 07 '25 05:01 saket424

Element Call got available with https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/9970603f153f44c1ee3368275ce3e58c2a0586b8 ! :tada:

luixxiul avatar Mar 17 '25 06:03 luixxiul

As a future reference, I was banging my head why the endpoint /sfu/get would throw {"errcode":"M_LOOKUP_FAILED","error":"Failed to look up user info from homeserver"}. In my case, turns out that I must have the federation feature ENABLED, or the lookup fails.

In my case, /data/homeserver.yaml:

server_name: "matrix.example.com"
pid_file: /data/homeserver.pid
listeners:
  - port: 8008
    tls: false
    type: http
    x_forwarded: true
    resources:
      - names: [federation, client] # <--- MUST include federation
        compress: false

# I still limited federation to my own server as seen below, and disabled features
federation_domain_whitelist: ["matrix.example.com"]
enable_federation: false
allow_public_rooms_over_federation: false

Couldn't find that documented anywhere, so here it goes.

Fusseldieb avatar Apr 23 '25 12:04 Fusseldieb

Federation is already listed as a requirement on the Matrix RTC documentation page's Prerequisites section.

This is also related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4232

spantaleev avatar Apr 23 '25 12:04 spantaleev

I am getting the following error. What am i doing wrong?

index-K2xIZ1TO.js:2 POST https://matrix.example.com/livekit-jwt-service/sfu/get 500 (Internal Server Error)

index-K2xIZ1TO.js:2 Failed to get JWT from RTC session's active focus URL of https://matrix.example.com/livekit-jwt-service. Error: SFU Config fetch failed with exception Error: SFU Config fetch failed with status code 500 at c$e (index-K2xIZ1TO.js:2:2261762) at async a$e (index-K2xIZ1TO.js:2:2261222)

I have matrix_homeserver_federation_enabled: true matrix_element_call_enabled: true

saket424 avatar Apr 24 '25 17:04 saket424