Commit 9c45b69c authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#8821: Renamed account map keys for consistency

parent 60bd10bf
......@@ -64,69 +64,70 @@ enum RegistrationState {
};
// Account identifier
static const char *const ACCOUNT_ID = "Account.id";
static const char *const CONFIG_ACCOUNT_ID = "Account.id";
// Common account parameters
static const char *const CONFIG_ACCOUNT_TYPE = "Account.type";
static const char *const CONFIG_ACCOUNT_ALIAS = "Account.alias";
static const char *const CONFIG_ACCOUNT_MAILBOX = "Account.mailbox";
static const char *const CONFIG_ACCOUNT_ENABLE = "Account.enable";
static const char *const CONFIG_ACCOUNT_RESOLVE_ONCE = "Account.resolveOnce";
static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire";
static const char *const CONFIG_CREDENTIAL_NUMBER = "Credential.count";
static const char *const ACCOUNT_DTMF_TYPE = "Account.dtmfType";
static const char *const CONFIG_ACCOUNT_DTMF_TYPE = "Account.dtmfType";
static const char *const CONFIG_RINGTONE_PATH = "Account.ringtonePath";
static const char *const CONFIG_RINGTONE_ENABLED = "Account.ringtoneEnabled";
static const char *const HOSTNAME = "hostname";
static const char *const USERNAME = "username";
static const char *const ROUTESET = "routeset";
static const char *const PASSWORD = "password";
static const char *const REALM = "realm";
static const char *const DEFAULT_REALM = "*";
static const char *const USERAGENT = "useragent";
static const char *const CONFIG_ACCOUNT_HOSTNAME = "Account.hostname";
static const char *const CONFIG_ACCOUNT_USERNAME = "Account.username";
static const char *const CONFIG_ACCOUNT_ROUTESET = "Account.routeset";
static const char *const CONFIG_ACCOUNT_PASSWORD = "Account.password";
static const char *const CONFIG_ACCOUNT_REALM = "Account.realm";
static const char *const CONFIG_ACCOUNT_DEFAULT_REALM = "*";
static const char *const CONFIG_ACCOUNT_USERAGENT = "Account.useragent";
static const char *const LOCAL_INTERFACE = "Account.localInterface";
static const char *const PUBLISHED_SAMEAS_LOCAL = "Account.publishedSameAsLocal";
static const char *const LOCAL_PORT = "Account.localPort";
static const char *const PUBLISHED_PORT = "Account.publishedPort";
static const char *const PUBLISHED_ADDRESS = "Account.publishedAddress";
static const char *const CONFIG_LOCAL_INTERFACE = "Account.localInterface";
static const char *const CONFIG_PUBLISHED_SAMEAS_LOCAL = "Account.publishedSameAsLocal";
static const char *const CONFIG_LOCAL_PORT = "Account.localPort";
static const char *const CONFIG_PUBLISHED_PORT = "Account.publishedPort";
static const char *const CONFIG_PUBLISHED_ADDRESS = "Account.publishedAddress";
static const char *const DISPLAY_NAME = "Account.displayName";
static const char *const DEFAULT_ADDRESS = "0.0.0.0";
static const char *const CONFIG_DISPLAY_NAME = "Account.displayName";
static const char *const CONFIG_DEFAULT_ADDRESS = "0.0.0.0";
// SIP specific parameters
static const char *const SIP_PROXY = "SIP.proxy";
static const char *const STUN_SERVER = "STUN.server";
static const char *const STUN_ENABLE = "STUN.enable";
static const char *const CONFIG_SIP_PROXY = "SIP.proxy";
static const char *const CONFIG_STUN_SERVER = "STUN.server";
static const char *const CONFIG_STUN_ENABLE = "STUN.enable";
// SRTP specific parameters
static const char *const SRTP_ENABLE = "SRTP.enable";
static const char *const SRTP_KEY_EXCHANGE = "SRTP.keyExchange";
static const char *const SRTP_ENCRYPTION_ALGO = "SRTP.encryptionAlgorithm"; // Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
static const char *const SRTP_RTP_FALLBACK = "SRTP.rtpFallback";
static const char *const ZRTP_HELLO_HASH = "ZRTP.helloHashEnable";
static const char *const ZRTP_DISPLAY_SAS = "ZRTP.displaySAS";
static const char *const ZRTP_NOT_SUPP_WARNING = "ZRTP.notSuppWarning";
static const char *const ZRTP_DISPLAY_SAS_ONCE = "ZRTP.displaySasOnce";
static const char *const TLS_LISTENER_PORT = "TLS.listenerPort";
static const char *const TLS_ENABLE = "TLS.enable";
static const char *const TLS_CA_LIST_FILE = "TLS.certificateListFile";
static const char *const TLS_CERTIFICATE_FILE = "TLS.certificateFile";
static const char *const TLS_PRIVATE_KEY_FILE = "TLS.privateKeyFile";
static const char *const TLS_PASSWORD = "TLS.password";
static const char *const TLS_METHOD = "TLS.method";
static const char *const TLS_CIPHERS = "TLS.ciphers";
static const char *const TLS_SERVER_NAME = "TLS.serverName";
static const char *const TLS_VERIFY_SERVER = "TLS.verifyServer";
static const char *const TLS_VERIFY_CLIENT = "TLS.verifyClient";
static const char *const TLS_REQUIRE_CLIENT_CERTIFICATE = "TLS.requireClientCertificate";
static const char *const TLS_NEGOTIATION_TIMEOUT_SEC = "TLS.negotiationTimeoutSec";
static const char *const TLS_NEGOTIATION_TIMEOUT_MSEC = "TLS.negotiationTimemoutMsec";
static const char *const REGISTRATION_STATUS = "Status";
static const char *const REGISTRATION_STATE_CODE = "Registration.code";
static const char *const REGISTRATION_STATE_DESCRIPTION = "Registration.description";
static const char *const CONFIG_SRTP_ENABLE = "SRTP.enable";
static const char *const CONFIG_SRTP_KEY_EXCHANGE = "SRTP.keyExchange";
static const char *const CONFIG_SRTP_ENCRYPTION_ALGO = "SRTP.encryptionAlgorithm"; // Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
static const char *const CONFIG_SRTP_RTP_FALLBACK = "SRTP.rtpFallback";
static const char *const CONFIG_ZRTP_HELLO_HASH = "ZRTP.helloHashEnable";
static const char *const CONFIG_ZRTP_DISPLAY_SAS = "ZRTP.displaySAS";
static const char *const CONFIG_ZRTP_NOT_SUPP_WARNING = "ZRTP.notSuppWarning";
static const char *const CONFIG_ZRTP_DISPLAY_SAS_ONCE = "ZRTP.displaySasOnce";
static const char *const CONFIG_TLS_LISTENER_PORT = "TLS.listenerPort";
static const char *const CONFIG_TLS_ENABLE = "TLS.enable";
static const char *const CONFIG_TLS_CA_LIST_FILE = "TLS.certificateListFile";
static const char *const CONFIG_TLS_CERTIFICATE_FILE = "TLS.certificateFile";
static const char *const CONFIG_TLS_PRIVATE_KEY_FILE = "TLS.privateKeyFile";
static const char *const CONFIG_TLS_PASSWORD = "TLS.password";
static const char *const CONFIG_TLS_METHOD = "TLS.method";
static const char *const CONFIG_TLS_CIPHERS = "TLS.ciphers";
static const char *const CONFIG_TLS_SERVER_NAME = "TLS.serverName";
static const char *const CONFIG_TLS_VERIFY_SERVER = "TLS.verifyServer";
static const char *const CONFIG_TLS_VERIFY_CLIENT = "TLS.verifyClient";
static const char *const CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE = "TLS.requireClientCertificate";
static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC = "TLS.negotiationTimeoutSec";
static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC = "TLS.negotiationTimemoutMsec";
static const char *const CONFIG_REGISTRATION_STATUS = "Registration.Status";
static const char *const CONFIG_REGISTRATION_STATE_CODE = "Registration.code";
static const char *const CONFIG_REGISTRATION_STATE_DESCRIPTION = "Registration.description";
// General configuration keys for accounts
static const char * const aliasKey = "alias";
......
......@@ -79,19 +79,19 @@ ConfigurationManager::getTlsSettingsDefault()
portstr << DEFAULT_SIP_TLS_PORT;
std::map<std::string, std::string> tlsSettingsDefault;
tlsSettingsDefault[TLS_LISTENER_PORT] = portstr.str();
tlsSettingsDefault[TLS_CA_LIST_FILE] = "";
tlsSettingsDefault[TLS_CERTIFICATE_FILE] = "";
tlsSettingsDefault[TLS_PRIVATE_KEY_FILE] = "";
tlsSettingsDefault[TLS_PASSWORD] = "";
tlsSettingsDefault[TLS_METHOD] = "TLSv1";
tlsSettingsDefault[TLS_CIPHERS] = "";
tlsSettingsDefault[TLS_SERVER_NAME] = "";
tlsSettingsDefault[TLS_VERIFY_SERVER] = "true";
tlsSettingsDefault[TLS_VERIFY_CLIENT] = "true";
tlsSettingsDefault[TLS_REQUIRE_CLIENT_CERTIFICATE] = "true";
tlsSettingsDefault[TLS_NEGOTIATION_TIMEOUT_SEC] = "2";
tlsSettingsDefault[TLS_NEGOTIATION_TIMEOUT_MSEC] = "0";
tlsSettingsDefault[CONFIG_TLS_LISTENER_PORT] = portstr.str();
tlsSettingsDefault[CONFIG_TLS_CA_LIST_FILE] = "";
tlsSettingsDefault[CONFIG_TLS_CERTIFICATE_FILE] = "";
tlsSettingsDefault[CONFIG_TLS_PRIVATE_KEY_FILE] = "";
tlsSettingsDefault[CONFIG_TLS_PASSWORD] = "";
tlsSettingsDefault[CONFIG_TLS_METHOD] = "TLSv1";
tlsSettingsDefault[CONFIG_TLS_CIPHERS] = "";
tlsSettingsDefault[CONFIG_TLS_SERVER_NAME] = "";
tlsSettingsDefault[CONFIG_TLS_VERIFY_SERVER] = "true";
tlsSettingsDefault[CONFIG_TLS_VERIFY_CLIENT] = "true";
tlsSettingsDefault[CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE] = "true";
tlsSettingsDefault[CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC] = "2";
tlsSettingsDefault[CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC] = "0";
return tlsSettingsDefault;
}
......
......@@ -114,32 +114,32 @@ void IAXAccount::setAccountDetails(std::map<std::string, std::string> details)
// Account setting common to SIP and IAX
alias_ = details[CONFIG_ACCOUNT_ALIAS];
type_ = details[CONFIG_ACCOUNT_TYPE];
username_ = details[USERNAME];
hostname_ = details[HOSTNAME];
password_ = details[PASSWORD];
username_ = details[CONFIG_ACCOUNT_USERNAME];
hostname_ = details[CONFIG_ACCOUNT_HOSTNAME];
password_ = details[CONFIG_ACCOUNT_PASSWORD];
enabled_ = details[CONFIG_ACCOUNT_ENABLE] == "true";
mailBox_ = details[CONFIG_ACCOUNT_MAILBOX];
displayName_ = details[DISPLAY_NAME];
userAgent_ = details[USERAGENT];
displayName_ = details[CONFIG_DISPLAY_NAME];
userAgent_ = details[CONFIG_ACCOUNT_USERAGENT];
}
std::map<std::string, std::string> IAXAccount::getAccountDetails() const
{
std::map<std::string, std::string> a;
a[ACCOUNT_ID] = accountID_;
a[CONFIG_ACCOUNT_ID] = accountID_;
a[CONFIG_ACCOUNT_ALIAS] = alias_;
a[CONFIG_ACCOUNT_ENABLE] = enabled_ ? "true" : "false";
a[CONFIG_ACCOUNT_TYPE] = type_;
a[HOSTNAME] = hostname_;
a[USERNAME] = username_;
a[PASSWORD] = password_;
a[CONFIG_ACCOUNT_HOSTNAME] = hostname_;
a[CONFIG_ACCOUNT_USERNAME] = username_;
a[CONFIG_ACCOUNT_PASSWORD] = password_;
a[CONFIG_ACCOUNT_MAILBOX] = mailBox_;
RegistrationState state(registrationState_);
a[REGISTRATION_STATUS] = mapStateNumberToString(state);
a[USERAGENT] = userAgent_;
a[CONFIG_REGISTRATION_STATUS] = mapStateNumberToString(state);
a[CONFIG_ACCOUNT_USERAGENT] = userAgent_;
return a;
}
......
......@@ -2386,7 +2386,7 @@ std::map<std::string, std::string> ManagerImpl::getAccountDetails(
}
AccountMap::const_iterator iter = accountMap_.find(accountID);
Account * account = 0;
Account * account = NULL;
if (iter != accountMap_.end())
account = iter->second;
......
......@@ -40,7 +40,7 @@ static const char * const historyLimitKey = "historyLimit";
static const char * const historyMaxCallsKey = "historyMaxCalls";
static const char * const notifyMailsKey = "notifyMails";
static const char * const zoneToneChoiceKey = "zoneToneChoice";
static const char * const registrationExpireKey = "registrationExpire";
static const char * const registrationExpireKey = "registrationexpire";
static const char * const portNumKey = "portNum";
static const char * const searchBarDisplayKey = "searchBarDisplay";
static const char * const zeroConfenableKey = "zeroConfenable";
......
This diff is collapsed.
......@@ -655,6 +655,8 @@ void SIPVoIPLink::registerKeepAliveTimer(pj_timer_entry& timer, pj_time_val& del
{
pj_status_t status;
DEBUG("UserAgent: Registering keep alive timer");
status = pjsip_endpt_schedule_timer(endpt_, &timer, &delay);
if (status != PJ_SUCCESS)
ERROR("Could not schedule new timer in pjsip endpoint");
......
......@@ -834,11 +834,19 @@ static GtkWidget* create_registration_expire(account_t *a)
GtkWidget *table, *frame, *label;
gchar *resolve_once=NULL, *account_expire=NULL;
gchar *orig_key = NULL;
if (a) {
resolve_once = g_hash_table_lookup(a->properties, ACCOUNT_RESOLVE_ONCE);
account_expire = g_hash_table_lookup(a->properties, ACCOUNT_REGISTRATION_EXPIRE);
gboolean gotkey = FALSE;
gotkey = g_hash_table_lookup_extended(a->properties, ACCOUNT_RESOLVE_ONCE, (gpointer)&orig_key, (gpointer)&resolve_once);
if(gotkey == FALSE) {
ERROR("could not retreive resolve_once from account properties");
}
gotkey = g_hash_table_lookup_extended(a->properties, ACCOUNT_REGISTRATION_EXPIRE, (gpointer)&orig_key, (gpointer)&account_expire);
if(gotkey == FALSE) {
ERROR("could not retreive %s from account properties", ACCOUNT_REGISTRATION_EXPIRE);
}
}
gnome_main_section_new_with_table(_("Registration"), &frame, &table, 2, 3);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
......@@ -852,7 +860,6 @@ static GtkWidget* create_registration_expire(account_t *a)
gtk_spin_button_set_value(GTK_SPIN_BUTTON(expireSpinBox), g_ascii_strtod(account_expire, NULL));
gtk_table_attach_defaults(GTK_TABLE(table), expireSpinBox, 1, 2, 0, 1);
entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic(_("_Comply with RFC 3263"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce),
g_strcasecmp(resolve_once,"false") == 0 ? TRUE: FALSE);
......
......@@ -62,17 +62,17 @@
#define ACCOUNT_ALIAS "Account.alias"
#define ACCOUNT_ENABLED "Account.enable"
#define ACCOUNT_MAILBOX "Account.mailbox"
#define ACCOUNT_USERAGENT "useragent"
#define ACCOUNT_USERAGENT "Account.useragent"
#define ACCOUNT_RESOLVE_ONCE "Account.resolveOnce"
#define ACCOUNT_REGISTRATION_EXPIRE "Account.expire"
#define ACCOUNT_REGISTRATION_EXPIRE "Account.registrationExpire"
#define ACCOUNT_SIP_STUN_SERVER "STUN.server"
#define ACCOUNT_SIP_STUN_ENABLED "STUN.enable"
#define ACCOUNT_DTMF_TYPE "Account.dtmfType"
#define ACCOUNT_HOSTNAME "hostname"
#define ACCOUNT_USERNAME "username"
#define ACCOUNT_ROUTE "routeset"
#define ACCOUNT_PASSWORD "password"
#define ACCOUNT_REALM "realm"
#define ACCOUNT_HOSTNAME "Account.hostname"
#define ACCOUNT_USERNAME "Account.username"
#define ACCOUNT_ROUTE "Account.routeset"
#define ACCOUNT_PASSWORD "Account.password"
#define ACCOUNT_REALM "Account.realm"
#define ACCOUNT_KEY_EXCHANGE "SRTP.keyExchange"
#define ACCOUNT_SRTP_ENABLED "SRTP.enable"
#define ACCOUNT_SRTP_RTP_FALLBACK "SRTP.rtpFallback"
......@@ -109,7 +109,7 @@
#define PUBLISHED_PORT "Account.publishedPort"
#define PUBLISHED_ADDRESS "Account.publishedAddress"
#define REGISTRATION_STATUS "Status"
#define REGISTRATION_STATUS "Registration.Status"
#define REGISTRATION_STATE_CODE "Registration.code"
#define REGISTRATION_STATE_DESCRIPTION "Registration.description"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment