javax.servlet.sip.URI.toString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中javax.servlet.sip.URI.toString()方法的一些代码示例,展示了URI.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URI.toString()方法的具体详情如下:
包路径:javax.servlet.sip.URI
类名称:URI
方法名:toString

URI.toString介绍

[英]Returns the value of this URI as a String. The result must be appropriately URL escaped.
[中]以字符串形式返回此URI的值。必须对结果进行适当的URL转义。

代码示例

代码示例来源:origin: org.restcomm/restcomm-connect.http

private void writeInviteUri(final URI requestUri, final JsonObject object) {
  object.addProperty("Initial Invite", requestUri.toString());
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public Address createAddress(URI uri) {
  if (logger.isDebugEnabled()) {
    logger.debug("Creating Address fromm URI[" + uri.toString()
        + "]");
  }
  URIImpl uriImpl = (URIImpl) uri;
  return new AddressImpl(SipFactoryImpl.addressFactory
      .createAddress(uriImpl.getURI()), null, ModifiableRule.Modifiable);
}

代码示例来源:origin: org.mobicents.servlet.sip/restcomm.media

@Override public String getOriginatorURI(){
  return initialInvite.getFrom().getURI().toString();
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public Address createAddress(URI uri, String displayName) {
  try {
    if (logger.isDebugEnabled()) {
      logger.debug("Creating Address from URI[" + uri.toString()
          + "] with display name[" + displayName + "]");
    }
    javax.sip.address.Address address = SipFactoryImpl.addressFactory
        .createAddress(((URIImpl) uri).getURI());
    address.setDisplayName(displayName);
    return new AddressImpl(address, null, ModifiableRule.Modifiable);
  } catch (ParseException e) {
    throw new IllegalArgumentException(e);
  }
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public List<ProxyBranch> createProxyBranches(List<? extends URI> targets) {
  ArrayList<ProxyBranch> list = new ArrayList<ProxyBranch>();
  for(URI target: targets)
  {
    if(target == null) {
      throw new NullPointerException("URI can't be null");
    }
    if(!JainSipUtils.checkScheme(target.toString())) {
      throw new IllegalArgumentException("Scheme " + target.getScheme() + " is not supported");
    }
    ProxyBranchImpl branch = new ProxyBranchImpl(target, this);
    branch.setRecordRoute(recordRoutingEnabled);
    branch.setRecurse(recurse);
    list.add(branch);
    this.proxyBranches.put(target, branch);
  }
  return list;
}

代码示例来源:origin: org.restcomm/restcomm-connect.http

private void writeInviteUri(final URI requestUri, final HierarchicalStreamWriter writer) {
  writer.startNode("Initial Invite");
  if (requestUri != null) {
    writer.setValue(requestUri.toString());
  }
  writer.endNode();
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public void proxyTo(final List<? extends URI> uris) {
  for (URI uri : uris)
  {
    if(uri == null) {
      throw new NullPointerException("URI can't be null");
    }
    if(!JainSipUtils.checkScheme(uri.toString())) {
      throw new IllegalArgumentException("Scheme " + uri.getScheme() + " is not supported");
    }
    final ProxyBranchImpl branch = new ProxyBranchImpl((URI) uri, this);
    branch.setRecordRoute(recordRoutingEnabled);
    branch.setRecurse(recurse);
    this.proxyBranches.put(uri, branch);
  }
  startProxy();
}

代码示例来源:origin: org.restcomm/restcomm-connect.telephony.api

logger.debug("ReqURI="+reqURI.toString()+" msgReqURI="+message.getRequestURI());
logger.debug("ReqURI="+reqURI.toString()+" msgReqURI="+message.getRequestURI());

代码示例来源:origin: org.restcomm/restcomm-connect.monitoring.service

callDetailsMap.put(senderPath, callInfo);
if (callInfo != null && callInfo.invite() != null) {
  callLocationMap.put(callInfo.invite().getAddressHeader(ContactHeader.NAME).getURI().toString(), sender);

代码示例来源:origin: org.restcomm/restcomm-connect.monitoring.service

/**
 * @param message
 * @param self
 * @param sender
 */
private void onStopObserving(StopObserving message, ActorRef self, ActorRef sender) throws ServletParseException {
  String senderPath = sender.path().name();
  callMap.remove(senderPath);
  CallInfo callInfo = callDetailsMap.remove(senderPath);
  if (callInfo != null && callInfo.invite() != null) {
    callLocationMap.remove(callInfo.invite().getAddressHeader(ContactHeader.NAME).getURI().toString());
  }
  if (callInfo.direction().equalsIgnoreCase("inbound")) {
    if (logger.isDebugEnabled()) {
      String msg = String.format("MonitoringService Removed inbound call from: %s to: %s, currently liveCalls: %d", callInfo.from(), callInfo.to(),callDetailsMap.size());
      logger.debug(msg);
    }
    incomingCallDetailsMap.remove(senderPath);
  } else {
    if (logger.isDebugEnabled()) {
      String msg = String.format("MonitoringService Removed outbound call from: %s to: %s, currently liveCallS: %d ", callInfo.from(), callInfo.to(),callDetailsMap.size());
      logger.debug(msg);
    }
    outgoingCallDetailsMap.remove(senderPath);
  }
  callStateMap.remove(senderPath);
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public void proxyTo(final URI uri) {
  if(uri == null) {
    throw new NullPointerException("URI can't be null");
  }
  if(!JainSipUtils.checkScheme(uri.toString())) {
    // Fix for Issue http://code.google.com/p/mobicents/issues/detail?id=2327, checking the route header
    RouteHeader routeHeader = (RouteHeader) originalRequest.getMessage().getHeader(RouteHeader.NAME);
    if(routeHeader == null || (routeHeader != null && !JainSipUtils.checkScheme(routeHeader.getAddress().getURI().toString()))) {
      throw new IllegalArgumentException("Scheme " + uri.getScheme() + " is not supported");
    }            
  }
  final ProxyBranchImpl branch = new ProxyBranchImpl(uri, this);
  branch.setRecordRoute(recordRoutingEnabled);
  branch.setRecurse(recurse);
  this.proxyBranches.put(uri, branch);
  startProxy();
}

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

addChallengeResponse(wwwAuthHeader, username, password, this.getRequestURI().toString());
if(uri == null) uri = this.getRequestURI().toString();
addChallengeResponse(proxyAuthHeader, username, password, uri);

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

authInfoEntry.getUserName(),
authInfoEntry.getPassword(),
this.getRequestURI().toString());
authInfoEntry.getUserName(),
authInfoEntry.getPassword(),
this.getRequestURI().toString());

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

this.getRequestURI().toString(),
"", // TODO: What is this entity-body?
wwwAuthHeader,
this.getRequestURI().toString(),
"", // TODO: What is this entity-body?
proxyAuthHeader,

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

public ProxyBranchImpl(URI uri, ProxyImpl proxy)
  this.targetURI = uri.toString();
  this.proxy = proxy;
  isAddToPath = proxy.getAddToPath();

代码示例来源:origin: org.restcomm/restcomm-connect.telephony.api

request.getSession().setAttribute("lastRequest", request);
if (logger.isInfoEnabled()) {
  logger.info("B2BUA (p2p proxy for DID and SIP URIs) - : Got request:\n" + request.getRequestURI().toString());
  logger.info(String.format("B2BUA: Proxying a session from %s to %s", from, to));

代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl

if (sipServletRequest.getSubscriberURI() != null) {
  sipSessionImpl.setSipSubscriberURI(sipServletRequest.getSubscriberURI().toString());

相关文章