congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Origin
Code IndexAdd Tabnine to your IDE (free)

How to use
Origin
in
javax.sdp

Best Java code snippets using javax.sdp.Origin (Showing top 4 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

if( o == null || "user".equals(o.getUsername()))
  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();
}
origin: org.jitsi/jain-sip-ri-ossonly

this.setOrigin((Origin) otherOrigin.clone());
javax.sdpOrigin

Most used methods

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

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 14 Best Plugins for Eclipse
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