I do manage to send and receive messages.
The problems is sometimes someone who is the receiver(person2) would send a message and the me being the sender(person1) would not receive the message, but the XMPP debug shows that the message from person2 was received but does not display.
Also person 2 cannot initiate a conversation i.e. start by sending the message to person but the message still shows its received in the debug.
Thanx in advance.