Happy New Year to all my persistent readers of XMPP for Dummies Blog !!!

Flash Back

As there has been a little gap since I wrote the previous blog, lets get a faint idea first of how we had set up the server.

So, there were 5 steps to setup the server:

Step 1: We installed ejabberd

Step 2: We configured and edited the ejabberd config file

Step 3: Restarted the server

Step 4: Created an admin account

Step 5: Go to, https://hostname:5280/admin, we entered our username and password and the server was setup.

XMPP’ing’

Moving forward, now that we have the server setup, lets try out a little bit of XMPP’ing’, using our new found ‘Stanza’ knowledge . 😉

We will need an IM client for it. I will be using PIDGIN ( https://www.pidgin.im/ ) for this.

First we will create a few users on our newly setup server. Lets go to, ‘https://hostname:5280/admin’, enter your username and password. Your screen should appear something like this.

Next, Click on ‘Virtual Hosts’, something like this will appear on the screen.

Now Click on “localhost” and then finally click on users

Further you need to create a few users here as i have !!

Next, lets register these users with PIDGIN.  In PIDGIN, go to ‘Accounts’ >> ‘Manage Accounts’ & ‘Add’

And likewise, add the other users also.

Once registered, go to ‘Tools’ >> ‘XMPP Console’, which will look similar to the image below. If the XMPP Console option is not available, then you can enable the XMPP Console plugin from ‘Tools’ >> ‘Plugins’.

Further, in this console we will send the stanzas we learnt in the XMPP -Part 4- Diving Deep into Stanzas blog. Lets try out sending a few of the stanzas by creating a group called “BlazeClanDemo”.

Now, in the “BlazeClan” group add a few users.

Lets get started with the simplest stanza- The presence stanza.

The presence stanza has already been described in the “Diving deep into stanzas” blog.

Moving further with it let’s change our status for the following users- ‘stany@localhost‘ and ‘userone@localhost‘ from available  to away.

Then type the presence stanza into the console.

By entering the presence stanza we can see the user’s status has now changed from ‘available’ to ‘away’. A few more status options available are  ‘dnd’ & ‘busy’. Also if you want to show ‘stany’s’ status as ‘available’ again, we just need to send a simple <presence /> stanza.

You all can try using the <status></status> option too !!!

Now we can try chatting between users with the help of the <message> stanza.

So, here in the image below user1@localhost is sending a message to stany@localhost which looks something like this:

And in the image below, stany@localhost is sending a message to user1@localhost !!!!

Now, Enjoy chattering with XMPP!!

Related Blogs:

XMPP for Dummies – Creating Your Own Chat Application from Scratch – Part1

XMPP for dummies – Part 2 – A 4 Step Life Cycle to Create Your Own Chatter!

XMPP for Dummies- Part 3- Stanzas in Detail

XMPP for Dummies- Part 4- Diving Deep into Stanzas

XMPP for Dummies- Part 5- Setting Up of the Server for Chat

Tags: , ,