Is there any way to fetch the user stats from a meeting?

Once the meeting is over, I want to know for how long a particular user was present in a meeting. Is it possible?
Right now I’m using JWT to start a meeting.

Thanks a lot, @damencho. :rocket:

Hello @damencho @shawn, Please help me if my understanding of this module is not correct. I’m using docker for my deployment.

  1. I have to add this module to the prosody. Below is a snippet of how I’m doing it.
Component "event_sync.meet.jitsi" "event_sync_component"
    muc_component = "muc.meet.jitsi"
    api_prefix = "http://event_sync_listner:7002/api"
    api_timeout = 10-- timeout if API does not respond within 10s
    retry_count = 5-- retry up to 5 times
    api_retry_delay = 1-- wait 1s between retries

    -- change retry rules so we also retry if endpoint returns HTTP 408
    api_should_retry_for_code = function (code)
        return code >= 500 or code == 408
    end

Prosody logs snippet for event-sync

event_sync.meet.jitsi:event_sync_component                   info       Start tracking occupants for aa@muc.meet.jitsi
http                                                         debug      Making HTTP POST request '559db5bbd610' to http://event_sync_listner:7002/api/events/room/created
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
event_sync.meet.jitsi:event_sync_component                   info       New occupant - {"name":"Shubham","joined_at":1644579160,"occupant_jid":"d7b877a0-9fe4-49de-b36b-d63ae6470915@meet.jitsi/VK-S89EB","email":""}
http                                                         debug      Making HTTP POST request '559db576a5a0' to http://event_sync_listner:7002/api/events/occupant/joined
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5cbe090' to http://event_sync_listner:7002/api/events/room/created
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5c11b30' to http://event_sync_listner:7002/api/events/occupant/joined
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5ac5c40' to http://event_sync_listner:7002/api/events/room/created
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5a8e880' to http://event_sync_listner:7002/api/events/occupant/joined
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5bb7be0' to http://event_sync_listner:7002/api/events/room/created
event_sync.meet.jitsi:event_sync_component                   debug      POST http://event_sync_listner:7002/api/events/room/created returned code 0
http                                                         debug      Making HTTP POST request '559db592ed90' to http://event_sync_listner:7002/api/events/occupant/joined
event_sync.meet.jitsi:event_sync_component                   debug      POST http://event_sync_listner:7002/api/events/occupant/joined returned code 0
event_sync.meet.jitsi:event_sync_component                   info       Occupant left - {"left_at":1644579268,"joined_at":1644579160,"occupant_jid":"d7b877a0-9fe4-49de-b36b-d63ae6470915@meet.jitsi/VK-S89EB","email":"","name":"Shubham"}
http                                                         debug      Making HTTP POST request '559db59fedf0' to http://event_sync_listner:7002/api/events/occupant/left
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
event_sync.meet.jitsi:event_sync_component                   info       Room destroyed - aa@muc.meet.jitsi
http                                                         debug      Making HTTP POST request '559db5cc0fc0' to http://event_sync_listner:7002/api/events/room/destroyed
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5c0ee00' to http://event_sync_listner:7002/api/events/occupant/left
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5aa35d0' to http://event_sync_listner:7002/api/events/room/destroyed
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db57fb670' to http://event_sync_listner:7002/api/events/occupant/left
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5ba5340' to http://event_sync_listner:7002/api/events/room/destroyed
event_sync.meet.jitsi:event_sync_component                   warn       API Response code 0. Will retry after 1s
http                                                         debug      Making HTTP POST request '559db5babca0' to http://event_sync_listner:7002/api/events/occupant/left
event_sync.meet.jitsi:event_sync_component                   debug      POST http://event_sync_listner:7002/api/events/occupant/left returned code 0
http                                                         debug      Making HTTP POST request '559db5ada440' to http://event_sync_listner:7002/api/events/room/destroyed
event_sync.meet.jitsi:event_sync_component                   debug      POST http://event_sync_listner:7002/api/events/room/destroyed returned code 0
  1. I have to create an external server that will listen to the POST requests sent by this module. I have to create the below RPC endpoints in the external server to handle the events like occupant-joined, occupant-left, room-created, and room-destroyed.
1. /api/events/occupant/joined
2. /api/events/room/created
3. /api/events/occupant/left
4. /api/events/room/destroyed

So I created a golang server that listens on port 7002 and prints the JSON data sent by the prosody for all the events. Since my setup is running on docker hence I created a docker image of this external server. I deployed it using the command docker run --name event_sync_listner -p 7002:7002 --network docker-jitsi-meet_meet.jitsi prayagsingh/jitsi-event-sync:latest where the network is the same network that jitsi setup is using. I can curl the server by exec into the prosody container but somehow I’m unable to receive the events on the server.

Since the external server is running on the same network then I can access it using the http://event_sync_listner:7002/api endpoint(from prosody container). Here event_sync_listner is the name of the external server container.

Please help.

At the glance the setup looks OK, and your logs do indicate that the events are being triggered. Alas the net.http.request calls are failing with response code 0.

There are many reasons why 0 might be returned, e.g. connection failed, cannot resolve domain, bad certs, etc. My first point of call would be to try running curl against the endpoint on the same host as prosody, by sounds like you’ve done that already.

Perhaps try logging out response_body at this point here and see if it offers more clues about why the call is failing? In many cases net.http would replace body with failure reason. :crossed_fingers:

Thanks a lot Shawn for responding. I added a check to print response_body and below is the snippet.

event_sync.meet.jitsi:event_sync_component                   warn       API Response body [unable to resolve service]

That probably means prosody was not able to resolve event_sync_listner to IP address and therefore cannot connect.

I’m afraid I’m not familiar with the docker setup to help you debug this other than point at DNS resolution as your current blocker.

yes, you are right. somehow it is not able to resolve container_name with container-IP. I don’t know why it is happening because curl is working fine(I ran it inside the prosody container) with container_name. So I changed the container_name to container_IP i.e http://172.23.0.6:7002/api and now it started working.

Thanks a lot Shawn.

1 Like