Where can i put log when module:send(stanza) comes from Prosody

Hi.
I am sending customized stanza from prosody plugin lua files.
When Prosody send a stanza through

module:send(stanza); or
module:send(reply_stanza);

In Jicofo I want to log/get the information. In jicofo where can I find these stanza, In which method module:send is triggered?

Thank you.

What does that do is to send a XMPP message either to the connection jid or the room jid. So in jicofo you can add a stanza listener to the connection to examine all incoming stanzas (this will include stanzas to different rooms) or add a message listener to the room if you are sending the stanza to the room.
Make sure you use the correct connection as jicofo establishes two connections one service and one client.

1 Like

Thank you damencho. Appreciate all of your responses. Basically, I am trying to explore and do some stuff that enables our system to understand and utilize many of Jitsi and its full architecture modified and in a controlled way.
I’ll work on your answer.

hi damencho, sorry to ping again. I was exploring Jicofo, In which class XMPP connection stanza listener should be added? Or I think there should be already added listeners for connection, and specific room, right?

In Jicofo in which class can, I find the XMPP connection and add stanza listener there?

hi, @damencho
I have added send_json_message() code in file

function occupant_affiliation_changed(event)
        local body_json = {};
        body_json.type = 'av_moderation';
        body_json.room = event.room.jid;
        local body_json_str = json.encode(body_json);
        send_json_message(event.room.jid, body_json_str);

And in Jicofo ChatRoomImpl.java file

AbstractXMPPConnection connection = xmppProvider.getXmppConnection();
connection.addSyncStanzaListener(this, StanzaTypeFilter.MESSAGE);

@Override
public void processStanza(Stanza packet) throws NotConnectedException, InterruptedException, NotLoggedInException {
        logger.info("stanza.from " + packet.getFrom());
        logger.info("stanza.toXML " + packet.toXML());
    }

But I am not getting any log here and can not make sure that prosody is sending XMPP. Please help with this.