Ejemplo n.º 1
0
  self.getExSIPConfig = function(data) {
    data = data || {};
    var userid = data.userId || cookieconfig.userid || self.networkUserId || Utils.randomUserid();

    var sip_uri = encodeURI(userid);
    if ((sip_uri.indexOf("@") === -1)) {
      sip_uri = (sip_uri + "@" + self.domainFrom);
    }

    var config = {
      'uri': sip_uri,
      'authorization_user': data.authenticationUserId || cookieconfig.authenticationUserid || userid,
      'password': data.password || cookieconfig.password,
      'ws_servers': self.websocketsServers,
      'stun_servers': 'stun:' + self.stunServer + ':' + self.stunPort,
      'trace_sip': self.debug,
      'enable_ims': self.enableIms,
      'enable_datachannel': self.enableDatachannel
    };

    // Add Display Name if set
    if (cookieconfig.displayName) {
      config.display_name = cookieconfig.displayName;
    }

    // do registration if User ID or register is set
    var register = data.authenticationUserId || cookieconfig.authenticationUserid || data.userId || cookieconfig.userid;
    if (register) {
      config.register = true;
    } else {
       // only set PAI if user is not registered
      config.p_asserted_identity = self.pAssertedIdentity;
      config.register = false;
    }
    return config;
  };
Ejemplo n.º 2
0
 self.encodingResolutionHeight = function() {
   return Utils.resolutionHeight(self.hd && Constants.R_1280x720 || self.encodingResolution);
 };