XMPP server : Openfire 3.9.3
XMPP Client :Asmack-android-8-4.0.4.jar
I am facing some strange behavior of openfire server when i am change the presence manually
Below is some piece of code from my Class
xmppConfig.setSendPresence(false);//Call first time only while configuration connection
presence = new Presence(Type.available, Constant.STATUS_ONLINE, 1, Mode.available);//code to change the presence of user
connection.sendPacket(presence);
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------
Normal logs where i able to change the presence of user (i checked on openfire portal and its works as accepted )
SENT (1): <presence id='z13q2-27'><status>online</status></presence>
RCV (1): <presence id="z13q2-26" from="rayan@**********.com/Smack" to="rayan@**********.com/Smack"><status>online</status></presence>
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------
After some ( 2-3) hours when i come back to application and try to set presence online (I checked on openfire portal and this user showing offline presence even though i set presence online )
SENT (1): <presence id='z13q2-27'><status>online</status></presence>
//**** No packet replay of change presence *********
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------
I checked below value after above scenario to check if user still connected , but i got below result which indicate that connection is alive and user is still connected but at the same time openfire port show that user offline ,
xmppManager.getConnection().isConnected() //Result(true)
xmppManager.getConnection().isAuthenticated() //Result(true)
xmppManager.getConnection().isAnonymous() //Result(false)
I am not able to send a message to someone nor receive message after above scenario
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------
SENT (0): <message id='9388u-21' to='rayan@*********.com' type='chat'><subject>nullMedia</subject><body>Test message</body><custom_data><aliasNmae>Robine H.</aliasNmae><profilePicUrl></profilePicUrl></custom_data><request xmlns='urn:xmpp:receipts'/></message>
above is log when i send message after above scenario ,here <custom_data> is my custom extension .
Even when i check history in openfire , there are no message stored after above scenario.
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------
I am not sure weather there is option to maintain the long lived connection over openfire server (web portal ) or i am doing something wrong here with the xmpp client.
Please guild me if anyone having some thoughts over this strange situation.