docs: function (completion, localWebRtcStream) {
            if (_peerConnection) {
              completion.call(null, null, _peerConnection);
              return;
            }
  
            _peerConnectionCompletionHandlers.push(completion);
  
            if (_peerConnectionCompletionHandlers.length > 1) {
              // The PeerConnection is already being setup, just wait for
              // it to be ready.
              return;
            }
  
            var pcConstraints = {
              optional: [
                // This should be unnecessary, but the plugin has issues if we remove it. This needs
                // to be investigated.
                {DtlsSrtpKeyAgreement: true},
  
                // https://jira.tokbox.com/browse/OPENTOK-21989
                {googIPv6: false}
              ]
            };
  
  
            OT.debug('Creating peer connection config "' + JSON.stringify(config) + '".');
  
            if (!config.iceServers || config.iceServers.length === 0) {
              // This should never happen unless something is misconfigured
              OT.error('No ice servers present');
            }
  
            OT.$.createPeerConnection(config, pcConstraints, localWebRtcStream,
                                            attachEventsToPeerConnection);
          }