本文整理了Java中javax.sip.address.AddressFactory.createURI()
方法的一些代码示例,展示了AddressFactory.createURI()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AddressFactory.createURI()
方法的具体详情如下:
包路径:javax.sip.address.AddressFactory
类名称:AddressFactory
方法名:createURI
暂无
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
public void setValue(String value) {
try {
this.uri = SipFactoryImpl.addressFactory.createURI(value);
} catch (ParseException ex) {
logger.error("Bad input arg", ex);
throw new IllegalArgumentException("Bad input arg", ex);
}
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
public void setValue(String value) {
try {
this.uri = SipFactoryImpl.addressFactory.createURI(value);
if(this.uri instanceof Parameters) {
super.setParameters(AddressImpl.getParameters((Parameters)uri));
} else {
super.setParameters(new ConcurrentHashMap
}
} catch (ParseException ex) {
logger.error("Bad input arg", ex);
throw new IllegalArgumentException("Bad input arg", ex);
}
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
try {
calleeCSeq = in.readLong();
callerCSeq = in.readLong();
calleeCOntact= SipFactoryImpl.addressFactory.createURI(in.readUTF());
callerCOntact= SipFactoryImpl.addressFactory.createURI(in.readUTF());
int routeSetSize = in.readInt();
for (int i = 0; i
callerRouteSet.add(route);
}
routeSetSize = in.readInt();
for (int i = 0; i
calleeRouteSet.add(route);
}
javax.sip.address.Address toAddress = SipFactoryImpl.addressFactory.createAddress(in.readUTF());
toHeader = (To) SipFactoryImpl.headerFactory.createToHeader(toAddress, in.readUTF());
javax.sip.address.Address fromAddress = SipFactoryImpl.addressFactory.createAddress(in.readUTF());
fromHeader = (From) SipFactoryImpl.headerFactory.createFromHeader(fromAddress, in.readUTF());
callId = in.readUTF();
} catch (ParseException e) {
throw new IllegalArgumentException("Problem occurred while unserializing ProxyTerminationInfo", e);
}
}
/*
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
public static MobicentsExtendedListeningPoint findListeningPoint(
SipNetworkInterfaceManager sipNetworkInterfaceManager,
Request request, String outboundInterface) {
MobicentsExtendedListeningPoint listeningPoint;
if(outboundInterface == null) {
String transport = findTransport(request);
listeningPoint = sipNetworkInterfaceManager.findMatchingListeningPoint(transport, false);
} else {
javax.sip.address.SipURI outboundInterfaceURI = null;
try {
outboundInterfaceURI = (javax.sip.address.SipURI) SipFactoryImpl.addressFactory.createURI(outboundInterface);
} catch (ParseException e) {
throw new IllegalArgumentException("couldn't parse the outbound interface " + outboundInterface, e);
}
listeningPoint = sipNetworkInterfaceManager.findMatchingListeningPoint(outboundInterfaceURI, false);
}
return listeningPoint;
}
代码示例来源:origin: org.mobicents.examples/call-controller2-sbbs
/**
* Attempt to find a list of Blocked Addresses (SIP URIs), but the method
* returns null if the called user (sipAddress) does not block to any user.
*/
private ArrayList getBlockedArrayList(String sipAddress) {
//sipAddress is AOR: sip:newbie@restcomm.com
ArrayList uris = null;
CallControlProfileCMP profile = super.lookup(new Address(AddressPlan.SIP,
sipAddress));
if (profile != null) {
Address[] addresses = profile.getBlockedAddresses();
if (addresses != null) {
uris = new ArrayList(addresses.length);
for (int i = 0; i
try {
SipURI uri = (SipURI) getAddressFactory().createURI(address);
uris.add(uri);
} catch (ParseException e) {
log.severe(e.getMessage(), e);
}
}
}
}
return uris;
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
public URI createURI(String uri) throws ServletParseException {
// if(!checkScheme(uri)) {
// // testCreateProxyBranches101 needs this to be IllegalArgumentExcpetion, but the test is wrong
// throw new ServletParseException("The uri " + uri + " is not valid");
// }
try {
javax.sip.address.URI jainUri = SipFactoryImpl.addressFactory
.createURI(uri);
if (jainUri instanceof javax.sip.address.SipURI) {
return new SipURIImpl(
(javax.sip.address.SipURI) jainUri, ModifiableRule.Modifiable);
} else if (jainUri instanceof javax.sip.address.TelURL) {
return new TelURLImpl(
(javax.sip.address.TelURL) jainUri);
} else {
return new GenericURIImpl(jainUri);
}
} catch (ParseException ex) {
throw new ServletParseException("Bad param " + uri, ex);
}
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
javax.sip.address.SipURI outboundInterfaceURI = (javax.sip.address.SipURI) SipFactoryImpl.addressFactory.createURI(outboundInterface);
host = outboundInterfaceURI.getHost();
} else {
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
javax.sip.address.SipURI outboundInterfaceURI = (javax.sip.address.SipURI) SipFactoryImpl.addressFactory.createURI(session.getOutboundInterface());
lp = sipNetworkInterfaceManager.findMatchingListeningPoint(outboundInterfaceURI, false);
} else {
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
/**
* @param proxyBranch
* @param request
* @param proxy
* @param poppedURI
*/
private static void addRecordRouteHeader(
Request request, SipFactoryImpl sipFactoryImpl,
javax.sip.address.SipURI poppedURI) {
try {
SipURI recordRouteURI = (SipURI)((RecordRouteHeader)request.getHeader(RecordRouteHeader.NAME)).getAddress().getURI();
javax.sip.address.SipURI newRecordRouteURI = (javax.sip.address.SipURI)
sipFactoryImpl.getAddressFactory().createURI(recordRouteURI.toString());
newRecordRouteURI.removeParameter(MessageDispatcher.SIP_OUTBOUND_PARAM_OB);
newRecordRouteURI.setUser(poppedURI.getUser());
RecordRouteHeader recordRouteHeader = sipFactoryImpl.getHeaderFactory().createRecordRouteHeader(
sipFactoryImpl.getAddressFactory().createAddress(newRecordRouteURI));
// removes the header created when the request was cloned
request.removeFirst(RecordRouteHeader.NAME);
request.addFirst(recordRouteHeader);
} catch (ParseException e) {
logger.error("Impossible to parse the following popped URI " + poppedURI, e);
} catch (SipException e) {
logger.error("Impossible to add the following recordRouteHeader ", e);
}
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
javax.sip.address.SipURI outboundInterfaceURI = (javax.sip.address.SipURI) SipFactoryImpl.addressFactory.createURI(outboundInterface);
ipAddressToCheckAgainst = ((gov.nist.javax.sip.address.SipUri)outboundInterfaceURI).getHost();
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
outboundInterfaceURI = (javax.sip.address.SipURI) SipFactoryImpl.addressFactory.createURI(outboundInterface);
} catch (ParseException e) {
throw new IllegalArgumentException("couldn't parse the outbound interface " + outboundInterface, e);
代码示例来源:origin: org.mobicents.servers.diameter.examples/openims-example-sbb
URI uri = sipProvider.getAddressFactory().createURI(toAddressString);
Request req = sipMessageFactory.createRequest(uri, Request.MESSAGE, this.sipProvider.getNewCallId(),
sipHeaderFactory.createCSeqHeader(1L, Request.MESSAGE), fromHeader, toHeader, viaHeaders, maxForwards);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
logger.debug("Routing the request externally " + sipServletRequest );
request.setRequestURI(SipFactoryImpl.addressFactory.createURI(routes[0]));
try {
forwardRequestStatefully(sipServletRequest, null, sipRouteModifier);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
javax.sip.address.SipURI outboundInterfaceURI = (javax.sip.address.SipURI) SipFactoryImpl.addressFactory.createURI(outboundInterface);
String outboundHost = ((gov.nist.javax.sip.address.SipUri)outboundInterfaceURI).getHost();
contactSipUri.setHost(outboundHost);
代码示例来源:origin: org.mobicents.examples/sip-wake-up-sbb
try {
URI requestURI = addressFactory.createURI(registration
.getContactAddress());