code: function disconnectBody() {
          var key;
          self.loggingOut = true;
          offersPending = {};
          acceptancePending = {};
          self.disconnecting = true;
          closedChannel = self.webSocket;
  
          if( stillAliveTimer ) {
             clearTimeout(stillAliveTimer);
             stillAliveTimer = null;
          }
  
          if (self.webSocketConnected) {
              if (!preallocatedSocketIo) {
                  self.webSocket.close();
              }
              self.webSocketConnected = false;
          }
          self.hangupAll();
          if (roomOccupantListener) {
              for (key in lastLoggedInList) {
                  if (lastLoggedInList.hasOwnProperty(key)) {
                      roomOccupantListener(key, {}, false);
                  }
              }
          }
          lastLoggedInList = {};
          self.emitEvent("roomOccupant", {});
          self.roomData = {};
          self.roomJoin = {};
          self.loggingOut = false;
          self.myEasyrtcid = null;
          self.disconnecting = false;
          oldConfig = {};
      }
docs: easyrtc.disconnect performs a clean disconnection of the client from the server.