0

I have just started on with ejabberd server. My question is how to send message from ejabberd server to multiple clients. I was able to send message to a single client using the command:

ejabberdctl send_message chat 192.168.33.50 user1@192.168.33.50 "subject" "message from server"

(where 192.168.33.50 is the IP address of the machine running ejabberd) However, I could not find a way to send to multiple clients at once. I suppose the method would be to create a group, add users to the group and send message to the group.

I tried to the following commands to create a group and add users to it:

ejabberdctl srg_create group1 192.168.33.50 "group1" "group1" "group1"
ejabberdctl srg_user_add user1 192.168.33.50 group1 192.168.33.50
ejabberdctl srg_user_add user2 192.168.33.50 group1 192.168.33.50

However, when I tried sending message with the following command using the group name instead of user name, no message was sent from the server:

ejabberdctl send_message chat 192.168.33.50 group1@192.168.33.50 "subject" "message from server"

So I wanted to know how I can achieve my use case of sending messages to multiple clients from the ejabberd server?

Archit Sinha
  • 775
  • 1
  • 8
  • 33

1 Answers1

0

Message broadcast can be achieved by using XEP-0033. As answered here by Mickaël : ejabberd server broadcast message

However, In Ejabberd Business Edition, "start_mass_message" command can be used for message broadcast.

  • Thanks for the answer. However I want to know how I can use/enable XEP-0033 to send message to multiple clients. I read somewhere that "mod_multicast" needs to be enabled in ejabberd.yml file for this. Is that correct? Also the basic question I have is what command I should run to achieve this (the equivalent of "ejabberdctl send_message" which works for single user). I looked at all the ejabberdctl commands and couldn't find any? So is it that I need to start ejabberd in interactive mode(using "ejabberdctl live") and paste the complete message in XML format? – Archit Sinha May 16 '17 at 10:04