Examples of ViaImpl


Examples of com.ericsson.ssa.sip.ViaImpl

                if (viaHeader != null) {
                    ListIterator<String> viaIterator;
                    viaIterator = viaHeader.getValues();
   
                    if (viaIterator.hasNext()) {
                        ViaImpl via = new ViaImpl(viaIterator.next());
                       
                        String outboundIndicated = via.getParameter(OUTBOUND_PARAM);
   
                        if (outboundIndicated != null) {
                            // This response was received from the back-end,
                            // pop Via, extract connection and forward it to the client.
                            viaHeader.setReadOnly(false);
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

    }
   
    private void pushVia(SipServletRequestImpl request)  {
        Header viaHeader = request.getRawHeader(Header.VIA);
       
        ViaImpl topVia = null;
        String branchId;
        if (viaHeader == null) {
           
        } else {
            topVia = new ViaImpl(viaHeader.getValue());
            branchId = createBranchId(request, topVia);
            ViaImpl via = new ViaImpl("SIP", SipTransports.TCP_PROT.name(), getContainerAddress().toString());
            via.setParameter(OUTBOUND_PARAM, "");
           
            via.setParameter(ViaImpl.PARAM_BRANCH, branchId);
            viaHeader.setValue(via.toString(), true);
        }
    }
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

        if (vstr == null) {
          SipServletResponseImpl resp = req.createTerminatingResponse(400, "Missing via in request");
          return resp;
        }
       
        ViaImpl via = null;
       
        try {
          via = new ViaImpl(vstr);
        }
        catch(Throwable t){
          SipServletResponseImpl resp = req.createTerminatingResponse(400, "Via cannot be parsed");
          return resp;
        }
   
     
      String viaTransport = via.getTransport();           
      String remoteTransport = req.getRemote().getProtocol().name();
     
      if ( viaTransport!= null && remoteTransport != null && !viaTransport.equalsIgnoreCase(remoteTransport)) {
        SipServletResponseImpl resp = req.createTerminatingResponse(400, "Mismatch in VIA Transport");
        return resp;
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

      String viaHeaderString = resp.getHeader(Header.VIA);
     
      if(viaHeaderString == null){
        throw new IllegalArgumentException("Unable to resolve response without Via header");
      }
        ViaImpl via = new ViaImpl(viaHeaderString);
        SipTransports transport = SipTransports.getTransport(via.getTransport());

        if (transport == SipTransports.UDP_PROT) {
             TargetTuple tt = resolveRespUDP(resp, via);
             RecordRouteResolver.resolveTransport(resp, tt);
             return tt;
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

    /**
     * Use this method if: - udp/received failed - tcp/received failed
     */
    public TargetTuple resolveRespAlternate(SipServletResponseImpl resp)
        throws Exception {
        ViaImpl via = new ViaImpl(resp.getHeader(Header.VIA));

        return resolveResp3263_5(via);
    }
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

        if (topVia != null) {
            SipServletRequestImpl cancel = getRequest().createCancelImpl();

            // set top via of original request to CANCEL
            Header viaOfCancel = new MultiLineHeader(Header.VIA, true);
            ViaImpl v = new ViaImpl(topVia);
            viaOfCancel.setValue(v.toString(), true);
            cancel.setHeader(viaOfCancel);

            return cancel;
        } else {
            _log.log(Level.SEVERE,
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

        if ((topVia != null) && resp.getMethod().equals("INVITE")) {
            // An INVITE response need to save the topVia, which is used
            // by CANCEL to find it's way to the correct transaction...
            Header viaOfCancel = new MultiLineHeader(Header.VIA, true);
            ViaImpl v = new ViaImpl(topVia);
            viaOfCancel.setValue(v.toString(), true);
            resp.setCancelVia(viaOfCancel);
        }

        // TODO could match to see that it's the right host'n port
        li.remove();
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

                log.log(Level.FINEST, "Via header transport: " +
                        ttToUse.getIP()+":"+ttToUse.getPort()+" Transport="+
                        ttToUse.getProtocol().name());
            }

            ViaImpl v = new ViaImpl(req.getProtocol(),
                    req.getTransport().toUpperCase(), ttToUse.getIP(),
                    ttToUse.getPort());
            String id = Transaction.generateBranch();
            v.setParameter(ViaImpl.PARAM_BRANCH, id);

            if (log.isLoggable(Level.FINE)) {
                log.log(Level.FINE, "Adding via = " + v);
            }

            String string_via = v.toString();
            if (req.getHeader("VIA_NEXTHOP_PARAMETERS") != null) {
              // special handling for applications that wants to affect the future via
              String via_nexthop_parameters = req.getHeader("VIA_NEXTHOP_PARAMETERS");
              req.removeHeader("VIA_NEXTHOP_PARAMETERS"); // we should never keep this header when request is sent
              string_via += ';'+ via_nexthop_parameters;  // plain String concatenation, knowledge & responsiblity is of application
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

        return _tm = new TransactionManager();
    }

    private String getBranchId(SipServletResponseImpl resp) {
        ViaImpl via = null;

        // Get the branch from the top VIA
        String vstr = resp.getHeader(Header.VIA);

        if ((vstr != null) && ((via = new ViaImpl(vstr)) != null)) {
            String id = null;

            // TODO Add a check of the magic cockie to the parsing of ViaImpl
            if ((id = via.getParameter(ViaImpl.PARAM_BRANCH)) != null) {
                return id;
            }
        }

        return null;
View Full Code Here

Examples of com.ericsson.ssa.sip.ViaImpl

        return null;
    }

    private String getBranchId(SipServletRequestImpl req) {
        ViaImpl via = null;

        // Get the branch from the top VIA
        String vstr = req.getHeader(Header.VIA);

        if ((vstr != null) && ((via = new ViaImpl(vstr)) != null)) {
            String id = null;

            // TODO Add a check of the magic cockie to the parsing of ViaImpl
            if ((id = via.getParameter(ViaImpl.PARAM_BRANCH)) != null) {
                return id;
            } else // Calculate an id according to rules from rfc2543
            {
                return createBranchId(req, via);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.