req.removeViaHeader();
via.setBranch(SipProvider.pickBranch());
req.addViaHeader(via);
qop = (qopOptions != null) ? "auth" : null;
DigestAuthentication digest = new DigestAuthentication(SipMethods.REGISTER,
req.getRequestLine().getAddress().toString(), wwwAuthHeader, qop, null, username, passwd);
AuthorizationHeader authHeader;
if (code == 401)
authHeader = digest.getAuthorizationHeader();
else
authHeader = digest.getProxyAuthorizationHeader();
req.setAuthorizationHeader(authHeader);
TransactionClient t = new TransactionClient(sipProvider, req, this);
t.request();