[jitsi-dev] Get number of current rooms and participants from prosody


#1

Dear all,

I would like to send an http request to prosody to get the number of current rooms and participants.
I see that mod_muc_size.lua module allows us to get this kind of information but it only returns the number of participants for a specific room.

is there any trick to get the number of ALL current rooms and participants?

Many thanks for your help in advance.

Regards
Hamza


#2

Hi,

You can add new handles in mod_muc_size if current are not working for you.
You can check sessions query which is already there, it should give you all
muc participants count, I suppose including jicofo in each room, if you
remove the resource part from the keys(which are jids) and count the unique
occurrences you will get the number of rooms.

Regards
damencho

···

On Tue, Nov 21, 2017 at 9:12 AM, KHAIT Hamza - SG/SPSSI/CPII/DOSE/ET/PNE ANNUAIRE ET MESSAGERIE <hamza.khait@i-carre.net> wrote:

Dear all,

I would like to send an http request to prosody to get the number of
current rooms and participants.
I see that mod_muc_size.lua module allows us to get this kind of
information but it only returns the number of participants for a specific
room.

is there any trick to get the number of ALL current rooms and participants?

Many thanks for your help in advance.

Regards
Hamza

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#3

Hi Damian,

Thanks for your response.
I didn't understand what you actually meant by "the resource part from the keys". do you mean the parameter "prosody.full_sessions" ?

For the number of participants the line below returns all muc participants count + only one jicofo (not jicofo in each room)
["GET sessions"] = function () return tostring(it.count(it.keys(prosody.full_sessions))); end;

Regards
Hamza

···

Le 21/11/2017 16:40, > Damian Minkov (par Internet, dépôt dev-bounces@jitsi.org) a écrit :

Hi,

You can add new handles in mod_muc_size if current are not working for you. You can check sessions query which is already there, it should give you all muc participants count, I suppose including jicofo in each room, if you remove the resource part from the keys(which are jids) and count the unique occurrences you will get the number of rooms.

Regards
damencho

On Tue, Nov 21, 2017 at 9:12 AM, KHAIT Hamza - > SG/SPSSI/CPII/DOSE/ET/PNE ANNUAIRE ET MESSAGERIE > <hamza.khait@i-carre.net> wrote:

Dear all,

I would like to send an http request to prosody to get the number of current rooms and participants.
I see that mod_muc_size.lua module allows us to get this kind of information but it only returns the number of participants for a specific room.

is there any trick to get the number of ALL current rooms and participants?

Many thanks for your help in advance.

Regards
Hamza

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

--
Hamza KHAIT
PNE Annuaire et Messagerie
Ministère de la Transition Écologique et Solidaire


#4

Hi Damian,

Thanks for your response.
I didn't understand what you actually meant by "the resource part from the
keys". do you mean the parameter "prosody.full_sessions" ?

You need to add new handler as sessions. And in it remove the resource part
of every prosody.full_sessions item and count the unique roomname@conf..
this will give you the number of rooms.

For the number of participants the line below returns all muc participants
count + only one jicofo (not jicofo in each room)
["GET sessions"] = function () return
tostring(it.count(it.keys(prosody.full_sessions)));
end;

Regards
Hamza

Hi,

···

On Nov 22, 2017 08:09, "KHAIT Hamza - SG/SPSSI/CPII/DOSE/ET/PNE ANNUAIRE ET MESSAGERIE" <hamza.khait@i-carre.net> wrote:
Le 21/11/2017 16:40, > Damian Minkov (par Internet, dépôt dev-bounces@jitsi.org) a écrit :

You can add new handles in mod_muc_size if current are not working for
you. You can check sessions query which is already there, it should give
you all muc participants count, I suppose including jicofo in each room, if
you remove the resource part from the keys(which are jids) and count the
unique occurrences you will get the number of rooms.

Regards
damencho

On Tue, Nov 21, 2017 at 9:12 AM, KHAIT Hamza - SG/SPSSI/CPII/DOSE/ET/PNE > ANNUAIRE ET MESSAGERIE <hamza.khait@i-carre.net> wrote:

Dear all,

I would like to send an http request to prosody to get the number of
current rooms and participants.
I see that mod_muc_size.lua module allows us to get this kind of
information but it only returns the number of participants for a specific
room.

is there any trick to get the number of ALL current rooms and
participants?

Many thanks for your help in advance.

Regards
Hamza

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

--
Hamza KHAIT
PNE Annuaire et Messagerie
Ministère de la Transition Écologique et Solidaire