Tabnine Logo
Origin.setAddress
Code IndexAdd Tabnine to your IDE (free)

How to use
setAddress
method
in
javax.sdp.Origin

Best Java code snippets using javax.sdp.Origin.setAddress (Showing top 3 results out of 315)

origin: org.restcomm/restcomm-connect.commons

private static void fix(final Origin origin, final String externalIp) throws UnknownHostException, SdpException {
  if (origin != null) {
    if (Connection.IN.equals(origin.getNetworkType())) {
      if (Connection.IP4.equals(origin.getAddressType())) {
        final InetAddress address;
        try {
          address = DNSUtils.getByName(origin.getAddress());
          final String ip = address.getHostAddress();
          if (!IPUtils.isRoutableAddress(ip)) {
            origin.setAddress(externalIp);
          }
        } catch (UnknownHostException e) {
          // TODO do nothing cause domain name is unknown
          // origin.setAddress(externalIp); to remove
        }
      }
    }
  }
}
origin: jitsi/ice4j

o.setAddress(defaultAddress.getHostAddress());
o.setAddressType(addressFamily);
origin: org.restcomm/restcomm-connect.telephony.api

@SuppressWarnings("unchecked")
private static String patch(final byte[] data, final String externalIp) throws UnknownHostException, SdpException {
  final String text = new String(data);
  if(logger.isInfoEnabled()){
    logger.info("About to patch ");
    logger.info("SDP :" + text);
    logger.info("Using externalIP: " + externalIp);
  }
  final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(text);
  SessionName sessionName = SdpFactory.getInstance().createSessionName("Restcomm B2BUA");
  sdp.setSessionName(sessionName);
  // Handle the connection at the session level.
  fix(sdp.getConnection(), externalIp);
  // Handle the connections at the media description level.
  final Vector<MediaDescription> descriptions = sdp.getMediaDescriptions(false);
  for (final MediaDescription description : descriptions) {
    fix(description.getConnection(), externalIp);
  }
  sdp.getOrigin().setAddress(externalIp);
  return sdp.toString();
}
javax.sdpOriginsetAddress

Popular methods of Origin

  • clone
  • getAddress
  • getAddressType
  • getNetworkType
  • getUsername
  • setAddressType

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now