Package org.zoolu.sip.header

Examples of org.zoolu.sip.header.WwwAuthenticateHeader


      // no Authorization header found
         int result;
         if (type==SERVER_AUTHENTICATION) result=401; // response code 401 ("Unauthorized")
         else result=407; // response code 407 ("Proxy Authentication Required")
         err_resp=MessageFactory.createResponse(msg,result,SipResponses.reasonOf(result),null);
         WwwAuthenticateHeader wah;
         if (type==SERVER_AUTHENTICATION) wah=new WwwAuthenticateHeader("Digest");
         else wah=new ProxyAuthenticateHeader("Digest");
         wah.addRealmParam(realm);
         wah.addQopOptionsParam(qop_options);
         wah.addNonceParam(HEX(rand));
         err_resp.setWwwAuthenticateHeader(wah);
      }
      return err_resp;
   }
View Full Code Here


         ViaHeader via=req.getViaHeader();
         req.removeViaHeader();
         via.setBranch(SipProvider.pickBranch());
         req.addViaHeader(via);
         req.setCSeqHeader(req.getCSeqHeader().incSequenceNumber());
         WwwAuthenticateHeader wah;
         if (code==401) wah=msg.getWwwAuthenticateHeader();
         else wah=msg.getProxyAuthenticateHeader();
         String qop_options=wah.getQopOptionsParam();
         qop=(qop_options!=null)? "auth" : null;
         RequestLine rl=req.getRequestLine();
         DigestAuthentication digest=new DigestAuthentication(rl.getMethod(),rl.getAddress().toString(),wah,qop,null,username,passwd);
         AuthorizationHeader ah;
         if (code==401) ah=digest.getAuthorizationHeader();
View Full Code Here

TOP

Related Classes of org.zoolu.sip.header.WwwAuthenticateHeader

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.