Source:
<code>public Response updateIncomingPhoneNumber(final String accountSid, final String sid, final MultivaluedMap<String, String> data, final MediaType responseType) { try{ Account operatedAccount = accountsDao.getAccount(accountSid); secure(operatedAccount, "RestComm:Modify:IncomingPhoneNumbers"); final IncomingPhoneNumber incomingPhoneNumber = dao.getIncomingPhoneNumber(new Sid(sid)); if (incomingPhoneNumber == null) { return status(NOT_FOUND).build(); } secure(operatedAccount, incomingPhoneNumber.getAccountSid(), SecuredType.SECURED_STANDARD ); boolean updated = true; if(phoneNumberProvisioningManager != null && (incomingPhoneNumber.isPureSip() == null || !incomingPhoneNumber.isPureSip())) { String domainName = organizationsDao.getOrganization(operatedAccount.getOrganizationSid()).getDomainName(); phoneNumberParameters.setVoiceUrl((callbackPort == null || callbackPort.trim().isEmpty()) ? domainName : domainName+":"+callbackPort); if(logger.isDebugEnabled()) logger.debug("updateNumber " + incomingPhoneNumber +" phoneNumberParameters: " + phoneNumberParameters); updated = phoneNumberProvisioningManager.updateNumber(convertIncomingPhoneNumbertoPhoneNumber(incomingPhoneNumber), phoneNumberParameters); } if(updated) { dao.updateIncomingPhoneNumber(update(incomingPhoneNumber, data)); if (APPLICATION_JSON_TYPE == responseType) { return ok(gson.toJson(incomingPhoneNumber), APPLICATION_JSON).build(); } else if (APPLICATION_XML_TYPE == responseType) { final RestCommResponse response = new RestCommResponse(incomingPhoneNumber); return ok(xstream.toXML(response), APPLICATION_XML).build(); } else { return null; } } return status(BAD_REQUEST).entity("21452").build(); }catch(Exception e){ <START> logger.error("", e); <END> return status(INTERNAL_SERVER_ERROR).build(); } }</code><technical_language>@maria-farooq provide a description log message</technical_language>

Target:
public Response updateIncomingPhoneNumber(final String accountSid, final String sid, final MultivaluedMap<String, String> data, final MediaType responseType) { Account operatedAccount = accountsDao.getAccount(accountSid); secure(operatedAccount, "RestComm:Modify:IncomingPhoneNumbers"); try{ final IncomingPhoneNumber incomingPhoneNumber = dao.getIncomingPhoneNumber(new Sid(sid)); if (incomingPhoneNumber == null) { return status(NOT_FOUND).build(); } secure(operatedAccount, incomingPhoneNumber.getAccountSid(), SecuredType.SECURED_STANDARD ); boolean updated = true; if(phoneNumberProvisioningManager != null && (incomingPhoneNumber.isPureSip() == null || !incomingPhoneNumber.isPureSip())) { String domainName = organizationsDao.getOrganization(operatedAccount.getOrganizationSid()).getDomainName(); phoneNumberParameters.setVoiceUrl((callbackPort == null || callbackPort.trim().isEmpty()) ? domainName : domainName+":"+callbackPort); if(logger.isDebugEnabled()) logger.debug("updateNumber " + incomingPhoneNumber +" phoneNumberParameters: " + phoneNumberParameters); updated = phoneNumberProvisioningManager.updateNumber(convertIncomingPhoneNumbertoPhoneNumber(incomingPhoneNumber), phoneNumberParameters); } if(updated) { dao.updateIncomingPhoneNumber(update(incomingPhoneNumber, data)); if (APPLICATION_JSON_TYPE == responseType) { return ok(gson.toJson(incomingPhoneNumber), APPLICATION_JSON).build(); } else if (APPLICATION_XML_TYPE == responseType) { final RestCommResponse response = new RestCommResponse(incomingPhoneNumber); return ok(xstream.toXML(response), APPLICATION_XML).build(); } else { return null; } } return status(BAD_REQUEST).entity("21452").build(); }catch(Exception e){ logger.error("Exception while performing updateIncomingPhoneNumber: ", e); return status(INTERNAL_SERVER_ERROR).build(); } }