How can i end meeting (outside the meeting ) in my website

if i have a dashboard and i have a list of my running meetings and there is an option to end the running meeting by a button , how can i handle that from server side ?

any help @damencho ?

How are you currently getting the list of running meetings for your dashboard?

If you already have a custom prosody module to expose that list as API endpoint, then it should be reasonable straight-forward to add an endpoint that takes the room jid as input. It can then look up room by jid and call something like this to end the meeting:

room:destroy(nil, 'The meeting has been terminated')

Naturally, you’ll want to make sure that endpoint is not publicly accessible.

1.i get the list from my data base …and every record carry the id in my data base
2.yes i have my custom prosody modules , and they work perfectly ,
just i wanna simulate and do same function as the tool do in my front and back side ,
i mean for example i want in dashboard list of running meetings when the user click an button , i end the meeting in the tool , as if user click "end meeting for all " button inside the meeting ??
can i call an api with the room_id or something ?
i noticed when the user click "end meeting for all " button , there is a call to api (domain?http-bind?room=&token=…)

I don’t think you can call it in exactly the same way as a meeting participant without first joining as a participant. Hence my suggestion about about a custom prosody module that exposes an endpoint that will trigger a room:destroy() call which will have similar effect.

he will join as a participant already and he will be a moderator ,
i can send in the api the jwt which have an info about that user that he is a moderator ,
just the process will be outside the meeting like this
so can i implement this ?

If this is all on the same page – i.e. you have a page which contains both the meeting session in an IFrame along with the dashboard you are referring to – then you can terminate the meeting using the endConference command from the IFrame API.

If your dashboard and meeting are effectively separate apps, then I don’t see how you can easily trigger than from your dashboard using the same meeting session.

they are separated yes , but i can have all info about the meeting and jwt of the user in dashboard ,but i dont know what should i call to end the meeting

I’m afraid I’m not sure how else I can help. I’ve already outlined above the only “clean” solutions that I know, which are to:

  1. create custom prosody endpoint (JWT protected) that accepts your HTTP call and terminates the room
  2. OR, terminate from an existing meeting session

I don’t know how else you can make a single call to end a meeting, even if you have access to JWT and room details. Perhaps someone else might offer suggestions that better meet your needs. Good luck with your project.

Oh, just thought of one more option – if you use JaaS, the do offer endpoints that you can call to terminate ongoing meetings.

i will try ,thanks so much for your time

hi there , i created a custom module and i user the fun (room:destroy(nil, END_CONFERENCE_REASON)) but i faced a problem about getting the room by that line ::
local room = get_room_by_name_and_subdomain(session.jitsi_web_query_room, session.jitsi_web_query_prefix);
my question is , if i end the meeting but not in the same tab ? this will cause a problem with the session which i pass it as a parameter to the func (get_room_by_name_and_subdomain) ??

Sorry, I’m not sure I understand what you mean. Can you elaborate further.

That function is something that runs in the prosody module on the server side, so not sure how that is affected by something running in your browser tab.

What session are you referring to?

The way I’d see this working, assuming you’re writing prosody module that exposes an API endpoint, would be for the API to take the room and subdomain as inputs, and you can then use that value to lookup your room object.

the room_name i put as a query param in GET api for example (261f5a10bd) my question is ,is it the same one which i pass to the (get_room_by_name_and_subdomain )func ?

yes.

what about subdomain ?

Leave it empty if it is not applicable.

IIRC, that refers to tenant-based rooms. So if the room is accesses using https://meet.yourdomain.com/orgABC/roomXYZ, then subdomain will be “orgABC”. If you don’t use that, then leave out subdomain.

ok my last question if my endpoint is >>> my_domain/api/end_meeting?room_name=261f5a10bd
how can i get the room_name from the endpoint request and set it in a variable in lua ?

Perhaps have a look at how this module does it?

i implemented same logic but i got an error which say ::
http.server error Traceback[httpserver]: /usr/share/lua/5.3/prosody/util/async.lua:154: /usr/share/jitsi-meet/prosody-plugins/util.lib.lua:149: attempt to index a boolean value (local ‘result’)
my code ::