code: private boolean generateDefaultDomainName(final Configuration configuration, final DaoManager storage, final SipURI sipUriHostAsFallbackDomain) {
          try {
              final Sid defaultOrganization = new Sid("ORafbe225ad37541eba518a74248f0ac4c");
              String hostname = configuration.getString("hostname");
  
              if (hostname != null && !hostname.trim().equals("")) {
                  if (logger.isInfoEnabled())
                      logger.info("Generate Default Domain Name based on RC hostname: " + hostname);
              } else {
                  if (sipUriHostAsFallbackDomain != null) {
                      logger.warn("Hostname property is null in restcomm.xml, will assign this host as domain: " + sipUriHostAsFallbackDomain.getHost());
                      hostname = sipUriHostAsFallbackDomain.getHost();
                  } else {
                      logger.error("Hostname property is null in restcomm.xml, As well restcomm outbound sipuri is NULL.");
                      return false;
                  }
              }
  
              Organization organization = storage.getOrganizationsDao().getOrganization(defaultOrganization);
              if (organization == null) {
                  storage.getOrganizationsDao().addOrganization(new Organization(defaultOrganization, hostname, DateTime.now(), DateTime.now(), Organization.Status.ACTIVE));
              } else {
                  organization = organization.setDomainName(hostname);
                  storage.getOrganizationsDao().updateOrganization(organization);
              }
          } catch (Exception e) {
              logger.error("Unable to generateDefaultDomainName {}", e);
              return false;
          }
          return true;
      }
docs: generateDefaultDomainName based on RC hostname
  https://github.com/RestComm/Restcomm-Connect/issues/2085
  
  @param configuration
  @param storage
  @param sipUriHostAsFallbackDomain - if hostname is not provided in restcomm.xml then provided sipuri host will be used as domain.