@Override
 protected void doBye(SipServletRequest request) throws ServletException, IOException {
   MediaGroup mediaGroup = (MediaGroup) request.getSession().getAttribute("MEDIA_GROUP");
   if (mediaGroup != null) {
     logger.info("Bye received, stopping the recording");
     try {
       mediaGroup.getRecorder().stop();
     } catch (MsControlException e) {
       logger.info("recording couldn't be stopped", e);
     }
   }
   super.doBye(request);
 }
 @Override
 public void init(ServletConfig servletConfig) throws ServletException {
   super.init(servletConfig);
 }