String middle_i, String last_name, String email, String login,
String password) {
try {
// Check if the OpenXG Gateway is enabled in general
Configuration sip_openxg_enable = cfgManagement.getConfKey(3L,
"sip.openxg.enable");
if (sip_openxg_enable == null
|| !sip_openxg_enable.getConf_value().equals("yes")) {
log.debug("SIP is disabled");
return null;
}
// client_id and client_secret
Configuration openxg_client_id = cfgManagement.getConfKey(3L,
"openxg.client.id");
Configuration openxg_client_secret = cfgManagement.getConfKey(3L,
"openxg.client.secret");
if (openxg_client_id == null || openxg_client_secret == null) {
throw new Exception(
"openxg.client.id or openxg.client.secret missing in Configuration table");
}
String client_id = openxg_client_id.getConf_value();
String client_secret = openxg_client_secret.getConf_value();
// domain
Configuration openxg_client_domain = cfgManagement.getConfKey(3L,
"openxg.client.domain");
if (openxg_client_domain == null) {
throw new Exception(
"openxg.client.domain missing in Configuration table");
}
String domain = openxg_client_domain.getConf_value();
// openxg_community_code
Configuration openxg_community_code = cfgManagement.getConfKey(3L,
"openxg.community.code");
if (openxg_community_code == null) {
throw new Exception(
"openxg.community.code missing in Configuration table");
}
String community_code = openxg_community_code.getConf_value();
// language_code
Configuration openxg_language_code = cfgManagement.getConfKey(3L,
"openxg.language.code");
if (openxg_language_code == null) {
throw new Exception(
"openxg.language.code missing in Configuration table");
}
String language_code = openxg_language_code.getConf_value();
// adminid
Configuration openxg_adminid = cfgManagement.getConfKey(3L,
"openxg.adminid");
if (openxg_adminid == null) {
throw new Exception(
"openxg.adminid missing in Configuration table");
}
String adminid = openxg_adminid.getConf_value();
// sip_language_phonecode, for example +358, is important as port of
// the
// number/login for the SIP-User via the applet
Configuration sip_language_phonecode = cfgManagement.getConfKey(3L,
"sip.language.phonecode");
if (sip_language_phonecode == null) {
throw new Exception(
"No sip.language.phonecode set in Configuration");
}
// Calculate the number in national format
Configuration sip_phonerange_start = cfgManagement.getConfKey(3L,
"sip.phonerange.start");
Configuration sip_phonerange = cfgManagement.getConfKey(3L,
"sip.phonerange");
Configuration sip_phonerange_currentindex = cfgManagement
.getConfKey(3L, "sip.phonerange.currentindex");
if (sip_phonerange_start == null || sip_phonerange == null
|| sip_phonerange_currentindex == null) {
throw new Exception(
"sip.phonerange.start, sip.phonerange or sip.phonerange.currentindex missing in Configuration table");