docs: function SessionManager(config) {
    if (! (this instanceof SessionManager)) {
      return new SessionManager(config);
    }
  
    EventEmitter.call(this);
  
    // initialise the room and our role
    this.room = config.room;
    this.role = config.role;
  
    // save the config
    this.cfg = config;
  
    // initialise our peers list
    this.peers = {};
  
    // initialise the streams data list
    this.streams = {};
  
    // initialise the session manager to expect at least one stream
    this.streamCount = 1;
    this.streamReadyCount = 0;
  
    // create our underlying socket connection
    this.socket = new Primus(config.signalhost);
    this.socket.on('open', this.emit.bind(this, 'active'));
  
    // initialise the channels configuration
    this.channels = [].concat(config.channels || []);
  
    // create our signalling interface
    this.signaller = createSignaller(this.socket);
  
    // hook up signaller events
    this._bindEvents(this.signaller, config);
  }