diff --git a/sflphone-client-gnome/src/accountlist.c b/sflphone-client-gnome/src/accountlist.c index 3f5dbe4c05fe8abf6929d9467fbc4f8b1da94dfc..d02e23c5feb91879a430ff6ec20d4df3e41acaad 100644 --- a/sflphone-client-gnome/src/accountlist.c +++ b/sflphone-client-gnome/src/accountlist.c @@ -161,7 +161,7 @@ void account_list_set_current (account_t *current) } -const gchar * account_state_name(account_state_t s) +const gchar * account_state_name (account_state_t s) { gchar * state; switch(s) @@ -193,6 +193,9 @@ const gchar * account_state_name(account_state_t s) case ACCOUNT_STATE_ERROR_EXIST_STUN: state = _("Stun server invalid"); break; + case IP2IP_PROFILE_STATUS: + state = _("Ready"); + break; default: state = _("Invalid"); break; diff --git a/sflphone-client-gnome/src/accountlist.h b/sflphone-client-gnome/src/accountlist.h index 1d7cff710a46b3ef4bda644f0898b9d5cbd7a9ff..bb2de673190d891264292e33e245b8d1924e57ad 100644 --- a/sflphone-client-gnome/src/accountlist.h +++ b/sflphone-client-gnome/src/accountlist.h @@ -50,8 +50,9 @@ typedef enum /** Stun server configuration error. The account is not registered */ ACCOUNT_STATE_ERROR_CONF_STUN, /** Stun server is not existing. The account is not registered */ - ACCOUNT_STATE_ERROR_EXIST_STUN - + ACCOUNT_STATE_ERROR_EXIST_STUN, + /** IP profile status **/ + IP2IP_PROFILE_STATUS } account_state_t; /** @struct account_t diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index a427845edeb91e850a5079b290b1c9cd9ac56853..ffe115d09b0ae5d039a5ece0c47605dcdd990a1b 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -265,6 +265,9 @@ void sflphone_fill_account_list (void) { { a->state = ACCOUNT_STATE_ERROR_EXIST_STUN; } + else if (strcmp (status, "READY") == 0) { + a->state = IP2IP_PROFILE_STATUS; + } else { a->state = ACCOUNT_STATE_INVALID; diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 17d59b27c69b6456ad39d0264da5cdea3e26f6ed..84582f2cac02efc8453d3ad07fb84f65a5756366 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -52,6 +52,7 @@ #include <sys/stat.h> // mkdir(2) #include <pwd.h> // getpwuid +#define DIRECT_IP_CALL "IP CALL" #define fill_config_str(name, value) \ (_config.addConfigTreeItem(section, Conf::ConfigTreeItem(std::string(name), std::string(value), type_str))) @@ -3368,7 +3369,9 @@ std::map< std::string, std::string > ManagerImpl::getAccountDetails (const Accou _debug ("Cannot getAccountDetails on a non-existing accountID %s. Defaults will be used.", accountID.c_str()); } - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, getConfigString (accountID, CONFIG_ACCOUNT_ALIAS))); + // The IP profile does not allow to set an alias + (accountID == IP2IP_PROFILE) ? a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, DIRECT_IP_CALL)) : + a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, getConfigString (accountID, CONFIG_ACCOUNT_ALIAS))); a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ENABLE, getConfigString (accountID, CONFIG_ACCOUNT_ENABLE))); a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_RESOLVE_ONCE, getConfigString (accountID, CONFIG_ACCOUNT_RESOLVE_ONCE))); @@ -3394,17 +3397,24 @@ std::map< std::string, std::string > ManagerImpl::getAccountDetails (const Accou std::string registrationStateDescription; if (account != NULL) { - state = account->getRegistrationState(); - int code = account->getRegistrationStateDetailed().first; - std::stringstream out; - out << code; - registrationStateCode = out.str(); - registrationStateDescription = account->getRegistrationStateDetailed().second; + if (accountID == IP2IP_PROFILE) { + registrationStateCode = EMPTY_FIELD; + registrationStateDescription = "Direct IP call"; + } + else { + state = account->getRegistrationState(); + int code = account->getRegistrationStateDetailed().first; + std::stringstream out; + out << code; + registrationStateCode = out.str(); + registrationStateDescription = account->getRegistrationStateDetailed().second; + } } else { state = Unregistered; } - a.insert (std::pair<std::string, std::string> (REGISTRATION_STATUS, mapStateNumberToString (state))); + (accountID == IP2IP_PROFILE) ? a.insert (std::pair<std::string, std::string> (REGISTRATION_STATUS, "READY")) : + a.insert (std::pair<std::string, std::string> (REGISTRATION_STATUS, mapStateNumberToString (state))); a.insert (std::pair<std::string, std::string> (REGISTRATION_STATE_CODE, registrationStateCode)); a.insert (std::pair<std::string, std::string> (REGISTRATION_STATE_DESCRIPTION, registrationStateDescription));