Package com.ericsson.ssa.sip.dns

Examples of com.ericsson.ssa.sip.dns.TargetTuple


        final InetSocketAddress local, final SipTransports transportProtocol,
        final InetSocketAddress socketAddress) {
        SipServletMessageImpl parsedMessage = null;

        try {
            final TargetTuple remote = new TargetTuple(transportProtocol,
                    socketAddress);

            // TODO - change so that the parser can do next(), to avoid
            // instanceof
            int initialSize = 0;
View Full Code Here


                if (resp != null) {
                    while (resp.popDispatcher() != null) {
                    } // After this layer it shouldn't go anywhere

                    TargetResolver tr = TargetResolver.getInstance();
                    TargetTuple tt = tr.resolveResponse(resp);

                    if (tt != null) {
                        resp.setRemote(tt);
                        dispatch(resp);
                    }
View Full Code Here

        boolean acceptRegister) throws IOException {
        super(n, l, true);
        _socketChannel = channel;
        _local = (InetSocketAddress) _socketChannel.socket()
                                                   .getLocalSocketAddress();
        _targetTuple = new TargetTuple(SipTransports.TCP_PROT,
                (InetSocketAddress) _socketChannel.socket()
                                                  .getRemoteSocketAddress());
        _socketChannel.configureBlocking(false);
        // local helper function for the constructors
        init();
View Full Code Here

        FlowToken flowToken = extractFlowToken(routeHeader);

        if (flowToken != null) {
            try {
                flowToken.validate();
                TargetTuple flowTuple = flowToken.getRemote();

                //connectionView.getInstance().getConnectionView()
                if (getConnectioView().contains(flowTuple)) {
                    //remove the route header
                    Address poppedRoute = req.popRouteHeader();
View Full Code Here

        final Protocol prot = ctx.getProtocol();
        final SelectionKey key = ctx.getSelectionKey();
        final SelectorHandler handler = ctx.getSelectorHandler();
      final ThreadAttachment currentTA = workerThread.getAttachment();

        TargetTuple remote = null;
        InetSocketAddress local = null;
        X509Certificate[] x509Certs = null;

        switch (prot) {
            case TCP:
                s = ((SocketChannel) key.channel()).socket();
                remoteAddress = (InetSocketAddress) s.getRemoteSocketAddress();
                remote = new TargetTuple(SipTransports.TCP_PROT, remoteAddress);
                local = (InetSocketAddress) s.getLocalSocketAddress();

                break;

            case UDP:
                if (!GrizzlyNetworkManager.useDefaultUDPSelectorHandler){
                    buffer = (ByteBuffer) ctx.removeAttribute
                            (GrizzlyNetworkManager.UDP_BUFFER);               
                } else {
                    ctx.setKeyRegistrationState(Context.KeyRegistrationState.NONE);               
                    handler.register(key, SelectionKey.OP_READ);
                }
                DatagramSocket d = ((DatagramChannel) key.channel()).socket();
                remoteAddress =
                        (InetSocketAddress) ctx.getAttribute(ReadFilter.UDP_SOCKETADDRESS);
                remote = new TargetTuple(SipTransports.UDP_PROT, remoteAddress);
                local = (InetSocketAddress) d.getLocalSocketAddress();
                break;

            case TLS:
                s = ((SocketChannel) key.channel()).socket();
                remoteAddress = (InetSocketAddress) s.getRemoteSocketAddress();
                remote = new TargetTuple(SipTransports.TLS_PROT, remoteAddress);
                local = (InetSocketAddress) s.getLocalSocketAddress();
                Object[] certs =
                        (Object[]) ctx.removeAttribute(GrizzlyNetworkManager.SIP_CERTS);

                if ((certs != null) && (certs.length > 0)) {
View Full Code Here

        while (resp.popDispatcher() != null) {
        }

        TargetResolver tr = TargetResolver.getInstance();
        TargetTuple tt = null;
        try {
            tt = tr.resolveResponse(resp);
        } catch (Exception e) {
            if (logger.isLoggable(Level.FINEST)) {
                logger.log(Level.FINEST,
View Full Code Here

        return null;
    }

    public TargetTuple getTargetTuple() {
        TargetTuple tt = new TargetTuple();
        tt.setBindIp(getHost());
        tt.setBindPort(getPort());
        return tt;
    }
View Full Code Here

        TargetTuple[] targetTuples = new TargetTuple[transports.size()];

        int i = 0;

        for (SipTransports st : transports) {
            targetTuples[i++] = new TargetTuple(st, address, port);
        }

        return targetTuples;
    }  
View Full Code Here

                Constants.DEFAULT_SIP_PORT);
        int sipsPort = resolvePublicPort(config.get(SIP_CONTAINER, "ExternalSipsPort"),
                Constants.DEFAULT_SIPS_PORT);

        TargetTuple[] targetTuples = {
                new TargetTuple(SipTransports.UDP_PROT, address, sipPort),
                new TargetTuple(SipTransports.TCP_PROT, address, sipPort),
                new TargetTuple(SipTransports.TLS_PROT, address, sipsPort)
  };
        return targetTuples;
    }
View Full Code Here

                resp.createTag(Header.TO);
            }

            try {
                TargetResolver tr = TargetResolver.getInstance();
                TargetTuple tt = tr.resolveResponse(resp);
                resp.setRemote(tt);
            } catch (Exception e) {
                e.printStackTrace();
                // Fallback if resolve failed, possibly because of Via missing or not parsable.
                resp.setRemote(req.getRemote());
View Full Code Here

TOP

Related Classes of com.ericsson.ssa.sip.dns.TargetTuple

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.