Package javax.servlet.sip

Examples of javax.servlet.sip.SipURI


    /**
     * Ensures that the node stays in the path for incoming new call.
     */
    private void addPathHeader(SipServletRequestImpl req) {
        FlowToken flowToken = createFlowToken(req.getInitialRemote(), req.getLocal());
        SipURI sipURI = getContainerAddress(flowToken);
        sipURI.setParameter("ob", "");
        Header header = Header.createFormatted(Header.PATH, req);
        header.setValue("<" + sipURI.toString() + ">", false);
       
        req.addHeader(header);
    }  
View Full Code Here


     * Ensures that the node stays in the path for the call.
     */
    private void addRecordRouteHeader(SipServletRequestImpl req) {

        FlowToken flowToken = createFlowToken(req.getInitialRemote(), req.getLocal());
        SipURI sipURI = getContainerAddress(flowToken);
        Header header = req.getRawHeader(Header.RECORD_ROUTE);
       
        if (header == null) {
            header = Header.createFormatted(Header.RECORD_ROUTE, req);
            //add route so that any request passes this node
            req.addHeader(header);
        }
       
        header.setValue("<" + sipURI.toString() + ">", false);
    }
View Full Code Here

     * @param value
     *                parameter value
     */
    public static void setParameter(URI uri, String name, String value) {
        if (uri instanceof SipURI) {
            SipURI sipUri = (SipURI) uri;
            sipUri.setParameter(name, value);
        } else {
            TelURLImpl telUrl = (TelURLImpl) uri;
            telUrl.setParameter(name, value);
        }
    }
View Full Code Here

     * @return the value of the removed parameter (or null if parameter does not
     *         exist)
     */
    public static String removeParameter(URI uri, String name) {
        if (uri instanceof SipURI) {
            SipURI sipUri = (SipURI) uri;
            String value = sipUri.getParameter(name);
            sipUri.removeParameter(name);

            return value;
        } else {
            TelURLImpl telUrl = (TelURLImpl) uri;
            String value = telUrl.getParameter(name);
View Full Code Here

     * @param name
     *           parameter name
     */
    public static String getParameter(URI uri, String name) {
        if (uri instanceof SipURI) {
            SipURI sipUri = (SipURI) uri;

            return sipUri.getParameter(name);
        } else {
            TelURLImpl telUrl = (TelURLImpl) uri;

            return telUrl.getParameter(name);
        }
View Full Code Here

       
        if (!isTelephoneNumber(uri)) return uri;
       
        if (uri.isSipURI()) {
            // Since we are modifying the uri we need a copy
            SipURI tmpUri = (SipURI) uri.clone();
            TelURL telUrl;
            try {
                telUrl = convertToTelURL(tmpUri);
                if (telUrl.isGlobal()) {
                    telUrl.setPhoneNumber("+" + com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(telUrl.getPhoneNumber()));
                } else {
                    telUrl.setPhoneNumber(com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(telUrl.getPhoneNumber()), telUrl.getPhoneContext());
                }
                tmpUri.setUser(getAsSipUriUser(telUrl));
            } catch (UriUtilException e) {
                // This was not a phone number. Silently ignore
            }

            return tmpUri;
        } else {
            // Since we are modifying the uri we need a copy
            TelURLImpl tmpUri = (TelURLImpl) uri.clone();
            if (tmpUri.isGlobal()) {
                tmpUri.setPhoneNumber("+" + com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(tmpUri.getPhoneNumber()));
            } else {
                tmpUri.setPhoneNumber(com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(tmpUri.getPhoneNumber()), tmpUri.getPhoneContext());
            }

            return tmpUri;
        }
    }
View Full Code Here

        } 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);
            return tt;
View Full Code Here

    public void updateDefaultTransportParameter(URI uri) {
        if (!uri.isSipURI()) {
            return;
        }

        SipURI sipURI = (SipURI) uri;

        if (sipURI.isSecure() || (sipURI.getTransportParam() != null)) {
            return; //Already right transport
        }

        boolean isDefaultTCPTransport = ResolverManager.getInstance()
                                                       .isDefaultTCPTransport();

        if (isDefaultTCPTransport) {
            sipURI.setTransportParam(SipTransports.TCP_PROT.name());
        }
    }
View Full Code Here

     *
     * @param uri
     * @return SipURI or null
     */
    private SipURI transformURI(URI uri) {
        SipURI sipUri = null;

        if (_log.isLoggable(Level.FINE)) {
            _log.log(Level.FINE, "transformURI uri: " + uri);
        }

        if (uri.isSipURI()) {
            sipUri = (SipURI) uri;

            String user = sipUri.getParameter("user");

            //           if(_log.isLoggable(Level.FINE))
            //           {
            //              _log.log(Level.FINE, "transformURI user: "+user);
            //           }
View Full Code Here

     * Resolve a TelURL to the users SipURI
     * @param uri
     * @return
     */
    private SipURI resolve(URI uri) {
        SipURI sipUri = null;

        if (_log.isLoggable(Level.FINE)) {
            _log.log(Level.FINE, "resolve uri: " + uri);
        }

View Full Code Here

TOP

Related Classes of javax.servlet.sip.SipURI

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.