Package javax.servlet.sip

Examples of javax.servlet.sip.URI


        return translator.normalize(localPhoneNumber,
                phoneContext);
    }

    public URI canonicalize(URI uri) {
        URI canonicalizedUri = translator.canonicalize(uri);

        return (canonicalizedUri != null) ? canonicalizedUri : uri;
    }
View Full Code Here


        return new TargetTuple(transport, host, port);
    }

    public TargetTuple resolveRequest(SipServletRequestImpl req, int msgSize)
        throws Exception {
        URI uri = null;
        String uriStr = null;

        if ((uriStr = req.getHeader(Header.ROUTE)) != null) {
            AddressImpl address = new AddressImpl(uriStr);
            uri = address.getURI();
        } else {
            uri = req.getRequestURI();
        }

        if (myDnsResolver.isTelephoneNumber(uri)) {
            SipURI sipuri = myDnsResolver.doLookupSipURI(uri);

            if (sipuri == null) {
                return null;
            }

            updateDefaultTransportParameter(sipuri);

            return resolveReq3263_4(sipuri, msgSize);
        } else if (uri.isSipURI()) {
            SipURI sipuri = (SipURI) uri;
            updateDefaultTransportParameter(sipuri);

            TargetTuple tt = resolveReq3263_4(sipuri, msgSize);
            RecordRouteResolver.resolveTransport(req, tt);
View Full Code Here

        } catch (ServletParseException ex) {
            logger.log(Level.SEVERE, null, ex);
            return;
        }       

        URI uri = (URI) addr.getURI();
        if (uri.isSipURI() && oi != null) {
            if (logger.isLoggable(Level.FINER)) {
                logger.log(Level.FINER, "Modifying ADDRESS ..." + oi.getHost());
            }
            SipURIImpl sipuri = (SipURIImpl) uri;
            if (oi.getHost() != null) {
View Full Code Here

            if ((status == 3) && getProxy().getRecurse()) {
                // If recurse is set and this is a 3xx response,
                // fork new requests to list of Contact
                AddressImpl address = null;
                URI uri = null;
                List<URI> contacts = new ArrayList<URI>(5);

                for (ListIterator<String> contactsIt = resp.getHeaders(
                            Header.CONTACT); contactsIt.hasNext();) {
                    String contact = (String) contactsIt.next();
View Full Code Here

    private void addRouteSet(SipServletMessageImpl m) {
        Iterator<URI> iter = m_RouteSet.iterator();

        while (iter.hasNext()) {
            Header routeHeader = new MultiLineHeader(Header.ROUTE, true);
            URI u = iter.next();
            routeHeader.setValue("<" + u.toString() + ">", false);
            m.addHeader(routeHeader);
        }
    }
View Full Code Here

    private boolean isLooseRoute() {
        boolean toReturn = false;

        if ((m_RouteSet != null) && !m_RouteSet.isEmpty()) {
            URI uri = m_RouteSet.getFirst();
            URIImpl uriImpl = (URIImpl) uri;
            toReturn = uriImpl.getLrParam();
        }

        return toReturn;
View Full Code Here

     *            SipURI
     */
    public UriWrapper(SipServletRequest req) {
        this.req = req;

        URI uriToBeWrapped = req.getRequestURI();

        if (!(uriToBeWrapped instanceof SipURI ||
                uriToBeWrapped instanceof TelURLImpl)) {
            throw new IllegalArgumentException("The URI class: " +
                uriToBeWrapped.getClass() + " is not supported");
        }
    }
View Full Code Here

                        rrouteAddress.getURI().isSipURI()) {
                    // 1. Use transport from top-most Record Route on the incoming Request
                    sipuri = (SipURI) rrouteAddress.getURI();
                } else {
                    // 2. Use transport from Contact
                    URI remoteTarget = getAddressHeaderImpl("Contact").getURI();

                    if (remoteTarget.isSipURI()) {
                        sipuri = (SipURI) remoteTarget;
                    }
                }

                if ((sipuri != null) && (sipuri.getTransportParam() != null)) {
View Full Code Here

    }
   
    public boolean isContainerAddress() {
        boolean found = false;
        if (!this.isWildcard()) {
            URI uri = this.getURI();

            // Check if the URI contains one of the listeners.
            if (uri.isSipURI()) {
                SipURI sipUri = (SipURI) uri;
                String host = sipUri.getHost();
                int port = sipUri.getPort();
                for (String publiccontext : SipBindingResolver.instance().
                        getPublicContexts()) {
View Full Code Here

    }

    public boolean isLocal() {
        boolean local = false;
        if (!this.isWildcard()) {
            URI uri = this.getURI();

            // Check if the URI contains localhost or 127.0.0.1
            if (uri.isSipURI()) {
                SipURI sipUri = (SipURI) uri;
                String host = sipUri.getHost();

                if (host.equalsIgnoreCase(LOCALHOST) ||
                        host.equals(LOCALIP)) {
View Full Code Here

TOP

Related Classes of javax.servlet.sip.URI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.