throws CommunicationsException {
try {
isUnregistering = false;
// From
FromHeader fromHeader = sipManCallback.getFromHeader(true);
Address fromAddress = fromHeader.getAddress();
sipManCallback.fireRegistering(fromAddress.toString());
// Request URI
SipURI requestURI = null;
try {
requestURI = sipManCallback.addressFactory.createSipURI(null,
registrarAddress);
}
catch (ParseException ex) {
throw new CommunicationsException("Bad registrar address:"
+ registrarAddress, ex);
}
catch (NullPointerException ex) {
// Do not throw an exc, we should rather silently notify the
// user
// throw new CommunicationsException("A registrar address was
// not specified!", ex);
sipManCallback.fireUnregistered(fromAddress.getURI().toString()
+ " (registrar not specified)");
return;
}
requestURI.setPort(registrarPort);