}
// Lock the DS for the entire duration.
SipSession session = m_RetransmitResponse.getSession();
DialogFragment dialog = ((SipSessionImplBase) session).getDF();
if (dialog != null) { // to be on the safe side
uow.lockDialog(dialog);
}
// issue 1085 :: create byeRequest before invoking the listeners.
// issue 1350 :: check that session is still valid. If app is undeployed it will not be
if(session.isValid()){
byeRequest = session.createRequest("BYE");