Package javax.sip.address

Examples of javax.sip.address.URI


    // @Override
    public boolean equals(Object that) {
        if (this==that) return true;
        else if (that instanceof URI) {
            final URI o = (URI) that;

            // This is not sufficient for equality; revert to String equality...
            // return this.getScheme().equalsIgnoreCase( o.getScheme() )
            return this.toString().equalsIgnoreCase( o.toString() );
        }
        return false;
    }
View Full Code Here


                    if ( credHash == null ) {
                        logger.logDebug("Could not find creds");
                        throw new SipException(
                        "Cannot find user creds for the given user name and realm");
                    }
                    URI uri = reoriginatedRequest.getRequestURI();
                    sipDomain = credHash.getSipDomain();
                    authorization = this.getAuthorization(reoriginatedRequest
                            .getMethod(), uri.toString(),
                            (reoriginatedRequest.getContent() == null) ? "" : new String(
                            reoriginatedRequest.getRawContent()), authHeader, credHash);
                } else {
                    UserCredentials userCreds = ((AccountManager) this.accountManager).getCredentials(challengedTransaction, realm);
                   
View Full Code Here

    public void processMessage(SIPMessage message) throws Exception {
      if(message instanceof Request) {
        Request request = (Request) message;
        if(request.getMethod().equals(Request.REGISTER)) {
          ContactHeader contact = (ContactHeader) request.getHeader(ContactHeader.NAME);
          URI uri = contact.getAddress().getURI();
          if(uri.isSipURI()) {
            SipURI sipUri = (SipURI) uri;
            String host = sipUri.getHost();
            NioTcpMessageProcessor processor = (NioTcpMessageProcessor) this.messageProcessor;
            HostPort hostPort = new HostPort();
            hostPort.setHost(new Host(host));
View Full Code Here

    // @Override
    public boolean equals(Object that) {
        if (this==that) return true;
        else if (that instanceof URI) {
            final URI o = (URI) that;

            // This is not sufficient for equality; revert to String equality...
            // return this.getScheme().equalsIgnoreCase( o.getScheme() )
            return this.toString().equalsIgnoreCase( o.toString() );
        }
        return false;
    }
View Full Code Here

      FromHeader from = headerFactory.createFromHeader(fromAddress, "1234");
      ToHeader to = headerFactory.createToHeader(addressFactory.createAddress("server@"+host+":"+SERVER_PORT), null);
      List via = Arrays.asList(((ListeningPointImpl)provider.getListeningPoint(testProtocol)).getViaHeader());     
      MaxForwardsHeader maxForwards = headerFactory.createMaxForwardsHeader(10);
       
        URI requestURI = addressFactory.createURI("sip:test@"+host+":"+SERVER_PORT);
        Request request = messageFactory.createRequest(requestURI, Request.REGISTER, callId, cSeq, from, to, via, maxForwards);
               
        request.setRequestURI(requestURI);
        request.addHeader(contactHeader1);
        request.addHeader(contactHeader2);
View Full Code Here

      ViaHeader via = ((ListeningPointImpl)provider.getListeningPoint(testProtocol)).getViaHeader();
      via.setRPort();
      List vias = Arrays.asList(via);     
      MaxForwardsHeader maxForwards = headerFactory.createMaxForwardsHeader(10);
       
        URI requestURI = addressFactory.createURI("sip:test@"+host+":"+SERVER_PORT);
        Request request = messageFactory.createRequest(requestURI, Request.INVITE, callId, cSeq, from, to, vias, maxForwards);
        System.out.println(request);
        assertTrue(request.toString().indexOf("rport=") == -1);       
       
        request.setRequestURI(requestURI);
View Full Code Here

            toNameAddress.setDisplayName(toDisplayName);
            ToHeader toHeader = headerFactory.createToHeader(toNameAddress,
                    null);

            // create Request URI
            URI requestURI = addressFactory.createURI("tel:46317014291;phone-context=+5");

            // Create ViaHeaders

            ArrayList viaHeaders = new ArrayList();
            ViaHeader viaHeader = headerFactory.createViaHeader("127.0.0.1",
View Full Code Here

    // @Override
    public boolean equals(Object that) {
        if (this==that) return true;
        else if (that instanceof URI) {
            final URI o = (URI) that;

            // This is not sufficient for equality; revert to String equality...
            // return this.getScheme().equalsIgnoreCase( o.getScheme() )
            return this.toString().equalsIgnoreCase( o.toString() );
        }
        return false;
    }
View Full Code Here

        if ( username == null || realm == null ) {
            return false;
        }
      
        String nonce = authHeader.getNonce();
        URI uri = authHeader.getURI();
        if (uri == null) {
            return false;
        }
       

     
        String A2 = request.getMethod().toUpperCase() + ":" + uri.toString();
        String HA1 = hashedPassword;

      
        byte[] mdbytes = messageDigest.digest(A2.getBytes());
        String HA2 = toHexString(mdbytes);
View Full Code Here

            return false;
        }
       

        String nonce = authHeader.getNonce();
        URI uri = authHeader.getURI();
        if (uri == null) {
           return false;
        }
       

        String A1 = username + ":" + realm + ":" + pass;
        String A2 = request.getMethod().toUpperCase() + ":" + uri.toString();
        byte mdbytes[] = messageDigest.digest(A1.getBytes());
        String HA1 = toHexString(mdbytes);

      
        mdbytes = messageDigest.digest(A2.getBytes());
View Full Code Here

TOP

Related Classes of javax.sip.address.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.