Package javax.servlet.sip

Examples of javax.servlet.sip.Address


      }
    }
   
    protected void setRemoteTarget(SipMessage message)
    {
      Address contact = message.getFields().getAddress(SipHeaders.CONTACT_BUFFER);
      if (contact != null)
        _remoteTarget = contact.getURI();
    }
View Full Code Here


        String method = request.getMethod();
        if (!method.equals("REGISTER")) {
            return;
        }
       
        Address contactAddress = null;
        try {
            contactAddress = request.getAddressHeader(Header.CONTACT);
        } catch (ServletParseException ex) {
            throw new SipRoutingException("Unable to get Contact header", ex);
        }

        if(contactAddress.getExpires() > 0){
            return;
        }
       
        String contact = null;
        if (contactAddress.getURI().isSipURI()) {
            contact = createContact((SipURI) contactAddress.getURI());
        } else {
            if (logger.isLoggable(Level.FINER)) {
                logger.finer("Contact address is not sip uri");
            }
            return;
View Full Code Here

                logger.finer("Contact address is not sip uri");
            }
            return;
        }

        Address storedPathValue = feAddrMapForRegisterReq.get(contact);
        if (storedPathValue == null) {
            SipSession session = request.getSession(false);
            if (session == null || !session.isValid()) {
                if (logger.isLoggable(Level.FINER)) {
                    logger.finer("Session is null or invalid");
View Full Code Here

        SipURI feSipUri = new SipURIImpl();
        feSipUri.setHost(hostName);
        feSipUri.setPort(port);
        feSipUri.setLrParam(true);
        feSipUri.setParameter(CLBConstants.FE_LB_PARAM, "TRUE");
        Address feAddress = SipFactoryImpl.getInstance().createAddress(feSipUri);
        return feAddress;
    }
View Full Code Here

        return retVal;
    }

    public Address getAddressValue() throws ServletParseException {
        if (!addressesOrValues.isEmpty()) {
            Address address = addressesOrValues.get(0).getAddressValue();

            // Even the address of a system header should be protected.
            ((AddressImpl) address).setReadOnly(_readOnly);

            return address;
View Full Code Here

    public ListIterator<Address> getAddressValues()
        throws ServletParseException {
        // Verify beforehand that we wont get a "ServletParseException" on next and previous
        for (AddressOrValue address : addressesOrValues) {
            Address a = address.getAddressValue();

            // Even the address of a system header should be protected.
            ((AddressImpl) a).setReadOnly(_readOnly);
        }
View Full Code Here

            // once here to check for a targeted request and once in the Factory
            // when we actually create the ss/sas for the request
            // maybe we can refactor a bit, so that if we have a targeted
            // request we already set the SAS that we found on the request somehow...
            String uriEncodedSasId = null;
            Address routeAddr = request.getInitialPoppedRoute();
            if (routeAddr != null) {
                uriEncodedSasId = UriUtil.getAndDecodeParameter(
                        routeAddr.getURI(), URIImpl.SASID_PARAM);
            }
            if (uriEncodedSasId == null)
                uriEncodedSasId = UriUtil.getAndDecodeParameter(request.getRequestURI(), URIImpl.SASID_PARAM);
            if (uriEncodedSasId != null) {
                appName = SipApplicationSessionUtil.getApplicationName(uriEncodedSasId);
View Full Code Here

        if (_currentRequest.getMethod().equals("INVITE") &&
                (_statusCode > 199) && !_isAlreadyACKGenerated) {
            // Indicate that we are to send an ACK.
            _isAlreadyACKGenerated = true;

            Address fromCopy = (Address) ((AddressImpl) getFromImpl()).clone(true,
                    true);
            Address toCopy = (Address) ((AddressImpl) getToImpl()).clone(true,
                    true);
            SipServletRequestImpl ack = new SipServletRequestImpl("ACK",
                    req.getRequestURI(), SipFactoryImpl.PROTOCOL_LINE);

            // set To
View Full Code Here

                "Not allowed to create an ACK in this transaction state.");
        }
    }

    public SipServletRequestImpl createAckImpl() throws IllegalStateException {
        Address fromCopy = (Address) ((AddressImpl) getFromImpl()).clone(true,
                true);
        Address toCopy = (Address) ((AddressImpl) getToImpl()).clone(true, true);
        DialogFragment df = getDialog();
        UA uac = null;

        if (isDirection() == Type.Caller) {
            // need to fetch the uac from the first item of the application path
View Full Code Here

        URI remoteTarget;
        remoteTarget = uac.getRemoteTarget();

        if (remoteTarget == null) {
            try {
                Address contact = getAddressHeaderImpl(Header.CONTACT);

                if (contact != null) {
                    remoteTarget = getAddressHeaderImpl(Header.CONTACT).getURI();

                    if (remoteTarget == null) {
View Full Code Here

TOP

Related Classes of javax.servlet.sip.Address

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.