// so that it appears as a default one next time user is prompted
// for pass
SIPConfig.setUserName(userName);
SIPConfig.setAuthUserName(authUserName);
UserCredentials initialCredentials = new UserCredentials();
initialCredentials.setUserName(userName);
initialCredentials.setAuthUserName(authUserName);
initialCredentials.setPassword(password.toCharArray());
register(initialCredentials.getUserName() + "@" + realm);
// at this point a simple register request has been sent and the
// global
// from header in SipManager has been set to a valid value by the
// RegisterProcesing
// class. Use it to extract the valid user name that needs to be
// cached by
// the security manager together with the user provided password.
initialCredentials.setUserName(((SipURI) getFromHeader()
.getAddress().getURI()).getUser());
// JOptionPane.showMessageDialog(null,( (SipURI)
// getFromHeader().getAddress().getURI()).getUser());