Not logged in. · Lost password · Register
Forum: XMPP Servers RSS
Page:  1  2  next
Avatar
Hari Dudani #1
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
Subject: Send message to multiple users
Hi Alex,

I want to send XMPP message to multiple users without using room through C# Matrix Library. I have openfire server and it support Extended Stanza Addressing XEP-0033.  I found some code for that.

  1. var addresses = new Addresses();
  2. addresses.AddAddress(new Address
  3.               {
  4.                   Type = Type.to,
  5.                   Jid = "hildjj@eworkplace0/Work",
  6.                   Description = "Joe Hildebrand"
  7.               });
  8.  
  9. addresses.AddAddress(new Address
  10.         {
  11.             Type = Type.cc,
  12.             Jid = "jer@eworkplace0/Home",
  13.             Description = "Jeremie Miller"
  14.         });
  15.  
  16. var msg = new Matrix.Xmpp.Client.Message();
  17.  
  18. msg.Add(addresses);
  19. msg.To = "multicast.jabber.org";
  20. msg.Body = "Hello, world!";

But message not receive to recipient. I have some doubt on Multicast service JID ( "multicast.jabber.org"). Is it correct for openfier server. If it is different, how i can find this address because i did not see this address on openfire server.

Thanks in Advance,
Hari
This post was edited on 2016-12-12, 18:26 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Hari Dudani:
But message not receive to recipient. I have some doubt on Multicast service JID ( "multicast.jabber.org"). Is it correct for openfier server. If it is different, how i can find this address because i did not see this address on openfire server.

multicast.jabber.org is definitely not the correct Jid for your Openfire server. You have to consult the Openfire admin panel or Openfire developers to get the correct Jid.
Avatar
Hari Dudani #3
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Thanks for your quick reply. Can you help me to find out this ID? because i search so many places but did not succeed . I asked the same on openfire forum but nobody reply. My domain is eworkplace0 so ID will be "multicast.eworkplace0" ?

Thanks,
Hari
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you can try to Disco your server for items. It should return the Jid then of the multicast component.
See here:
http://www.xmpp.org/extensions/xep-0030.html#items

Alex
Avatar
Hari Dudani #5
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex

this link is not working
http://www.xmpp.org/extensions/xep-0030.html#items

Thanks,
Hari
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
works fine for me and links to the XMPP extension XEP-0030: Service Discovery
Avatar
Hari Dudani #7
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
When i search through Disco Service, I am getting this result.

  1. <iq type="result" id="MX_3" from="eworkplace0" to="e6977c7b-37f0-4c0c-b1e2-922ba8523e95@eworkplace0/305b0fc7-9111-45c5-8817-9b979310253e" xmlns="jabber:client">
  2.  <query xmlns="http://jabber.org/protocol/disco#items">
  3.     <item jid="conference.eworkplace0" name="Public Chatrooms" />
  4.     <item jid="search.eworkplace0" name="User Search" />
  5.     <item jid="pubsub.eworkplace0" name="Publish-Subscribe service" />
  6.     <item jid="notify.eworkplace0" name="Broadcast service" />
  7.     <item jid="proxy.eworkplace0" name="Socks 5 Bytestreams Proxy" />
  8.     <item jid="test.eworkplace0" name="Public Chatrooms" />
  9.  </query>
  10. </iq>

 notify.eworkplace0  is correct ID ?
This post was edited on 2016-12-12, 20:33 by Alex.
Avatar
Alex #8
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Hari Dudani:
notify.eworkplace0  is correct ID ?

yes, looks like this is the correct one.
Avatar
Hari Dudani #9
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
But it's not working. My code is

  1. Addresses address = new Addresses();
  2.         address.AddAddress(new Address {
  3.           Type = Matrix.Xmpp.ExtendedStanzaAddressing.Type.To,
  4.           Jid = "30f0b810-e009-4763-9925-4b461b6472dc@eworkplace0/Work",
  5.           Description = "Test"
  6.       });
  7.  
  8.       string jid = string.Format("notify.eworkplace0");
  9.      
  10.       Matrix.Xmpp.Server.Message msg = new Matrix.Xmpp.Server.Message() {
  11.           To = new Jid(jid),
  12.           Type = MessageType.Chat,
  13.           Body = body,
  14.         };
  15.  
  16.        msg.Add(address);
  17.       _xmppClient.Send(msg);
This post was edited on 2016-12-12, 20:51 by Alex.
Avatar
Alex #10
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post the Xml log where we can see this stanza going out to your server, as well as the error reply from the server if there is any.
Are you sure that this user is online when you send it?

30f0b810-e009-4763-9925-4b461b6472dc@eworkplace0/Work

With the resource Work?
Avatar
Hari Dudani #11
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
This is the stanza XML
  1.  
  2.  <message to="notify@eworkplace0" type="chat" xmlns="jabber:server">
  3.  <body>sainath</body>
  4.  <addresses xmlns="http://jabber.org/protocol/address">
  5.     <address type="to" jid="30f0b810-e009-4763-9925-4b461b6472dc@eworkplace0/Home" desc="30f0b810-e009-4763-9925-4b461b6472dc" />
  6.  </addresses>
  7. </message>

This user is online. You can check this user presence by this url
http://ewp-dev54.eworkplace.com:9090/plugins/pre…?jid=30…

There is no error log in log file.
This post was edited on 2016-12-12, 21:24 by Alex.
Avatar
Hari Dudani #12
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
I am using "Home" as resource. Also check with remove resource.
Avatar
Alex #13
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you send to notify@eworkplace0, while it should be notify.eworkplace0
Avatar
Hari Dudani #14
Member since Nov 2016 · 18 posts
Group memberships: Members
Show profile · Link to this post
I tried with "notify.eworkplace0" but not working. Log xml is

  1. OnSendXML: <message to="notify.eworkplace0" type="chat" xmlns="jabber:server">
  2.  <body>sainath</body>
  3.  <addresses xmlns="http://jabber.org/protocol/address">
  4.     <address type="to" jid="30f0b810-e009-4763-9925-4b461b6472dc@eworkplace0/Home" desc="30f0b810-e009-4763-9925-4b461b6472dc" />
  5.  </addresses>
  6. </message>
  7.  
  8.  
  9. OnReceiveXML : <message to="a703@eworkplace0/28db660f-07e7-476d-b63d-38b82c7d2b91" from="notify.eworkplace0" type="error" xmlns="jabber:client">
  10.  <error code="405" type="cancel">
  11.     <not-allowed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  12.  </error>
  13.  <subject>Error sending broadcast message</subject>
  14.  <body>Address not valid: notify.eworkplace0</body>
  15. </message>
This post was edited on 2016-12-13, 10:50 by Alex.
Avatar
Alex #15
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the server sais:
Address not valid: notify.eworkplace0

sorry, but I don't think I cannot help you any further here. Please ask the Openfire support for the correct address and it should work fine.
Maybe the plugin is not enabled or installed at all on your server.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next
Forum: XMPP Servers RSS