title: I want to receive all users message using smack(Not in Group Chat)
body: <p><strong>I am creating a chat application ,one to one chatting is working properly ,but when comes to multi user chat i am not able to listen their messages
  I am using smack for implementing the XMPP protocol
  Here is the code</strong></p>
  <blockquote>
  <p>Server configuration part is</p>
  </blockquote>
  <pre><code>    public void serverCongig() throws XMPPException {
       
      LOGGER.info(String.format(&quot;Initializing connection to server %1$s port 
         %2$d&quot;, server, port));
      SmackConfiguration.setPacketReplyTimeout(packetReplyTimeout);
      config = new ConnectionConfiguration(server, 
          port,PropertyReader.getPropertiesValue(&quot;server_domain&quot;));
   //        config.setSASLAuthenticationEnabled(false);
      config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
       
      connection = new XMPPConnection(config);
      try
      {
         connection.connect();
          LOGGER.info(&quot;Connected: &quot; + connection.isConnected()+&quot; Service 
           name&quot;+connection.getServiceName());
          chatManager = connection.getChatManager();
          messageListener = new MyMessageListener();
      }
      catch(Exception e)
      {
                      callThread();
       
          e.printStackTrace();
      }
        finally
      {
          callThread();
      }
     
       
  }
  </code></pre>
  <p><strong>Message listening part is</strong>
  class MyMessageListener implements MessageListener {</p>
  <pre><code>    @Override
      public void processMessage(Chat chat, Message message) {
          try
          {
          String from = message.getTo();
          String body = message.getBody();
          String toUser=&quot;&quot;;
          LOGGER.info(String.format(&quot;Received message '%1$s' from %2$s&quot;, body, from));
          String[] user=from.split(&quot;@&quot;);
          for(int i=0;i&lt;user.length;i++)
           toUser=user[0];
          LOGGER.info(&quot;Receiver Phone number&quot;+toUser); 
          SendMsgToWhatsapp create=new SendMsgToWhatsapp();
          try {
              if(!body.equalsIgnoreCase(null))
              {
                create.processWhatsappMessage(toUser, body);
  
              }
          } catch (Exception ex) {
              callThread();
  </code></pre>
  <p>//                Logger.getLogger(XmppManager.class.getName()).log(Level.SEVERE, null, ex);
  }
  }
  catch(Exception e)
  {
  e.printStackTrace();
  callThread();
  }
  }</p>