public static void writeUnsupportedStanzaError(SessionContext sessionContext) {
Stanza errorStanza = ServerErrorResponses.getInstance().getStreamError(
StreamErrorCondition.UNSUPPORTED_STANZA_TYPE, sessionContext.getXMLLang(),
"service unavailable at this session state", null);
Stanza streamOpener = new ServerResponses().getStreamOpenerForError(false, sessionContext.getServerJID(),
XMPPVersion.VERSION_1_0, errorStanza);
writeErrorAndClose(sessionContext, streamOpener);
}