Package javax.servlet.sip

Examples of javax.servlet.sip.URI


                        return m.group(1);
                    }

                    if (returnCondition.equals("match.resolve.user")) {
                        DcrUtils dcrUtils = DcrUtils.getInstance();
                        URI canonicalizedUri = dcrUtils.canonicalize(m.group(1));
                        SipURI resolvedUri = dcrUtils.transformURI(canonicalizedUri);
                        if (resolvedUri != null) {
                            return dcrUtils.getUserOrPhoneNumber(resolvedUri);
                        } else {
                            return dcrUtils.getUserOrPhoneNumber(dcrUtils.normalize(canonicalizedUri));
View Full Code Here


     * there.
     *
     */
    private URI forgivingCreateURI(String x) throws ServletParseException {
        try {
            URI u = sf.createURI(x);

            if (logger.isLoggable(Level.FINER)) {
                logger.log(Level.FINER, "String: " + x + ", parsed to URI: " + u);
            }

View Full Code Here

    }

    private String getBestTelUriPhoneNumber(AddressTokenizer t) {
        while (t.hasMoreTokens()) {
            AddressTokenizer.Token t0 = t.nextToken();
            URI canonicalizedUri = null;

            try {
                switch (t0.code) {
                case 0:
                case 1:
                    canonicalizedUri = canonicalize(forgivingCreateURI(t0.token));

                    break;

                case 2:
                    canonicalizedUri = canonicalize(nameAddrCreateURI(t0.token));

                    break;
                }

                if (UriUtil.isTelephoneNumber(canonicalizedUri)) {
                    TelURL telUrl = null;

                    if (canonicalizedUri.isSipURI()) {
                        try {
                            telUrl = UriUtil.convertToTelURL((SipURI) canonicalizedUri);
                        } catch (UriUtilException e) {
                            if (logger.isLoggable(Level.FINE)) {
                                logger.log(Level.FINE, "Exception when converting to Tel-URL: " + t0.token);
View Full Code Here

        }
        resp.send();
    }

    private void sendRedirect(SipServletRequestImpl request) throws IOException {
        URI uriValue = request.getRequestURI();
        String uri = uriValue.toString();
        String port = null;

        try {
            port = AuthModule.getTLSPort();
        } catch (com.sun.enterprise.config.ConfigException ce) {
View Full Code Here

    private SipURI getUsableSipUri(AddressTokenizer t, boolean considerSipUris, String uris) {
        if (!t.hasMoreTokens()) {
            return (considerSipUris == false) ? null : getUsableSipUri(new AddressTokenizer(uris), false, null);
        } else {
            AddressTokenizer.Token t0 = t.nextToken();
            URI u0 = null;

            try {
                switch (t0.code) {
                case 0:
                case 1:
                    u0 = canonicalize(forgivingCreateURI(t0.token));

                    break;

                case 2:
                    u0 = canonicalize(nameAddrCreateURI(t0.token));

                    break;
                }
            } catch (ServletParseException e) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "multiple URIs, exception when parsing this one: " + t0.token);
                }

                // Continue with next
                return getUsableSipUri(t, considerSipUris, uris);
            }

            if ((u0 == null) || (u0.isSipURI() && !considerSipUris) || (!u0.isSipURI() && considerSipUris)) {
                return getUsableSipUri(t, considerSipUris, uris);
            } else {
                SipURI su0 = transformURI(u0);

                if ((su0 == null) || (su0.getUser() == null) || su0.getUser().equals("")) {
View Full Code Here

     * @return
     * @throws ServletParseException
     */
    private URI nameAddrCreateURI(String x) throws ServletParseException {
        Address a = sf.createAddress(x);
        URI u = a.getURI();

        if (logger.isLoggable(Level.FINER)) {
            logger.log(Level.FINER, "string: " + x + ", parsed to Address: " + a + ", and URI: " + u);
        }

View Full Code Here

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

        try {
            URI uri = forgivingCreateURI(uriStr);

            return canonicalize(uri);
        } catch (ServletParseException e) {
            // Return null at failure
            logger.log(Level.WARNING, "clb.sip.exception_transforming_uri",
View Full Code Here

       
    }
   
    private boolean isOutboundIndicated(Header contactHeader) {
        try {
            URI uri = contactHeader.getAddressValue().getURI();
            return (isOutboundIndicated(uri, true) || false/*TODO: is GRUU*/);
        } catch (ServletParseException e) {
        }
        return false;
    }
View Full Code Here

    }  
   
    private FlowToken extractFlowToken(Header routeHeader) {
        FlowToken flowToken = null;
        if (routeHeader != null) {
            URI sipURI = null;
            try {
                sipURI = routeHeader.getAddressValue().getURI();
               
                if (sipURI instanceof SipURIImpl) {
                    String flowId = ((SipURIImpl)sipURI).getUser();
View Full Code Here

    private void removeAlreadyUsedRecursiveContacts(SipServletResponseImpl resp) {
        // make sure that the targets have not been used before
        if ((resp.getStatus() / 100) == 3) {
            Address contact = null;
            URI uri = null;

            Header contacts = resp.getRawHeader(Header.CONTACT);
            contacts.setReadOnly(false);

            try {
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.