Send custom json message from prosody plug-in

Hi, I’m modifying a plugin that limits the length of a conference. I want to send a warning message before that happens. I’m using this code and many, many variations of it, based on the lobby and moderation code.

local body_json = {};
body_json.type = ‘call_ending’;
body_json.msg = “This video call will be automatically closed in 2 minutes”;

local body_json_str = json.encode(body_json);
st.message({ type = ‘groupchat’; from = room.jid })
:tag(‘json-message’, {xmlns=‘’})

and I am expecting to receive the message in the iFrame incomingMessage event but that doesn’t happen. Have I misunderstood something? Is that not where the message should end up? Or am I sending it incorrectly?


As you are not sending it from a participant a different event is fired lib-jitsi-meet/JitsiConferenceEventManager.js at 8f836678fb1dba674361f6fa044d0e6576b592cd · jitsi/lib-jitsi-meet · GitHub
JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED you can check in jitsi-meet code how is this handled, but I guess that doesn’t reach the iframe api.
If it make sense to reach it any PRs are welcome.

Thanks. Yes, that event is not making it to the iFrame API. I’m using the standard meet / iFrame AP, looks like I will have to investigate my own build. I will do a PR for it if I get it working.