diff --git a/src/com/savoirfairelinux/sflphone/service/ConfigurationManagerJNI.java b/src/com/savoirfairelinux/sflphone/service/ConfigurationManagerJNI.java index 484831bf635965620952ad0f4d2d105c2aaab0fd..8c8dc63d1e45c6207708bfad78a3ccda3cfd7a49 100644 --- a/src/com/savoirfairelinux/sflphone/service/ConfigurationManagerJNI.java +++ b/src/com/savoirfairelinux/sflphone/service/ConfigurationManagerJNI.java @@ -35,6 +35,10 @@ public class ConfigurationManagerJNI { } } + public StringMap getAccountDetails(String accountID) { + return new StringMap(SFLPhoneserviceJNI.ConfigurationManagerJNI_getAccountDetails(swigCPtr, this, accountID), true); + } + public void setAudioPlugin(String audioPlugin) { SFLPhoneserviceJNI.ConfigurationManagerJNI_setAudioPlugin(swigCPtr, this, audioPlugin); } diff --git a/src/com/savoirfairelinux/sflphone/service/ISipService.aidl b/src/com/savoirfairelinux/sflphone/service/ISipService.aidl index 853781175470e53c8475499ae468d414a1707beb..83f7a5d26eab242447a19c9f92798a566a4672b3 100644 --- a/src/com/savoirfairelinux/sflphone/service/ISipService.aidl +++ b/src/com/savoirfairelinux/sflphone/service/ISipService.aidl @@ -6,4 +6,5 @@ interface ISipService { void accept(in String callID); void hangUp(in String callID); void setAudioPlugin(in String callID); + Map getAccountDetails(in String accountID); } diff --git a/src/com/savoirfairelinux/sflphone/service/ServiceConstants.java b/src/com/savoirfairelinux/sflphone/service/ServiceConstants.java index 70b8409c5902b09204a02b8232878ec9fa4682f8..f11cc9b90f2fdd0b576e4853f95c7f3e576a3a26 100644 --- a/src/com/savoirfairelinux/sflphone/service/ServiceConstants.java +++ b/src/com/savoirfairelinux/sflphone/service/ServiceConstants.java @@ -5,4 +5,38 @@ public final class ServiceConstants { public static final String INTENT_SIP_SERVICE = "com.savoirfairelinux.sflphone.service.SipService"; public static final String EXTRA_OUTGOING_ACTIVITY = "outgoing_activity"; + public static final String INTERFACE_KEY = "interface"; + public static final String PORT_KEY = "port"; + public static final String PUBLISH_ADDR_KEY = "publishAddr"; + public static final String PUBLISH_PORT_KEY = "publishPort"; + public static final String SAME_AS_LOCAL_KEY = "sameasLocal"; + public static final String DTMF_TYPE_KEY = "dtmfType"; + public static final String SERVICE_ROUTE_KEY = "serviceRoute"; + public static final String KEEP_ALIVE_ENABLED = "keepAlive"; + public static final String SRTP_KEY = "srtp"; + public static final String SRTP_ENABLE_KEY = "enable"; + public static final String KEY_EXCHANGE_KEY = "keyExchange"; + public static final String RTP_FALLBACK_KEY = "rtpFallback"; + public static final String ZRTP_KEY = "zrtp"; + public static final String DISPLAY_SAS_KEY = "displaySas"; + public static final String DISPLAY_SAS_ONCE_KEY = "displaySasOnce"; + public static final String HELLO_HASH_ENABLED_KEY = "helloHashEnabled"; + public static final String NOT_SUPP_WARNING_KEY = "notSuppWarning"; + public static final String TLS_KEY = "tls"; + public static final String TLS_PORT_KEY = "tlsPort"; + public static final String CERTIFICATE_KEY = "certificate"; + public static final String CALIST_KEY = "calist"; + public static final String CIPHERS_KEY = "ciphers"; + public static final String TLS_ENABLE_KEY = "enable"; + public static final String METHOD_KEY = "method"; + public static final String TIMEOUT_KEY = "timeout"; + public static final String TLS_PASSWORD_KEY = "password"; + public static final String PRIVATE_KEY_KEY = "privateKey"; + public static final String REQUIRE_CERTIF_KEY = "requireCertif"; + public static final String SERVER_KEY = "server"; + public static final String VERIFY_CLIENT_KEY = "verifyClient"; + public static final String VERIFY_SERVER_KEY = "verifyServer"; + public static final String STUN_ENABLED_KEY = "stunEnabled"; + public static final String STUN_SERVER_KEY = "stunServer"; + public static final String CRED_KEY = "credential"; } diff --git a/src/com/savoirfairelinux/sflphone/service/SipService.java b/src/com/savoirfairelinux/sflphone/service/SipService.java index 6e41626ee893ceab65c0bdf3a25a96142074b835..1196da27a00bc75d1346370e2ee48aa6491dd072 100644 --- a/src/com/savoirfairelinux/sflphone/service/SipService.java +++ b/src/com/savoirfairelinux/sflphone/service/SipService.java @@ -40,6 +40,8 @@ import com.savoirfairelinux.sflphone.service.ManagerImpl; import com.savoirfairelinux.sflphone.client.SFLphoneApplication; import com.savoirfairelinux.sflphone.service.ISipService; +import java.util.HashMap; + public class SipService extends Service { static final String TAG = "SipService"; @@ -112,6 +114,48 @@ public class SipService extends Service { } }); } + + @Override + public HashMap<String,String> getAccountDetails(final String accountID) { + StringMap swigmap = configurationManagerJNI.getAccountDetails(accountID); + + HashMap<String, String> nativemap = new HashMap<String, String>(); + nativemap.put(ServiceConstants.INTERFACE_KEY, nativemap.get(ServiceConstants.INTERFACE_KEY)); + nativemap.put(ServiceConstants.PORT_KEY, nativemap.get(ServiceConstants.PORT_KEY)); + nativemap.put(ServiceConstants.PUBLISH_ADDR_KEY, nativemap.get(ServiceConstants.PUBLISH_ADDR_KEY)); + nativemap.put(ServiceConstants.PUBLISH_PORT_KEY, nativemap.get(ServiceConstants.PUBLISH_PORT_KEY)); + nativemap.put(ServiceConstants.SAME_AS_LOCAL_KEY, nativemap.get(ServiceConstants.SAME_AS_LOCAL_KEY)); + nativemap.put(ServiceConstants.DTMF_TYPE_KEY, nativemap.get(ServiceConstants.DTMF_TYPE_KEY)); + nativemap.put(ServiceConstants.SERVICE_ROUTE_KEY, nativemap.get(ServiceConstants.SERVICE_ROUTE_KEY)); + nativemap.put(ServiceConstants.KEEP_ALIVE_ENABLED, nativemap.get(ServiceConstants.KEEP_ALIVE_ENABLED)); + nativemap.put(ServiceConstants.SRTP_KEY, nativemap.get(ServiceConstants.SRTP_KEY)); + nativemap.put(ServiceConstants.SRTP_ENABLE_KEY, nativemap.get(ServiceConstants.SRTP_ENABLE_KEY)); + nativemap.put(ServiceConstants.KEY_EXCHANGE_KEY, nativemap.get(ServiceConstants.KEY_EXCHANGE_KEY)); + nativemap.put(ServiceConstants.RTP_FALLBACK_KEY, nativemap.get(ServiceConstants.RTP_FALLBACK_KEY)); + nativemap.put(ServiceConstants.ZRTP_KEY, nativemap.get(ServiceConstants.ZRTP_KEY)); + nativemap.put(ServiceConstants.DISPLAY_SAS_KEY, nativemap.get(ServiceConstants.DISPLAY_SAS_KEY)); + nativemap.put(ServiceConstants.DISPLAY_SAS_ONCE_KEY, nativemap.get(ServiceConstants.DISPLAY_SAS_ONCE_KEY)); + nativemap.put(ServiceConstants.HELLO_HASH_ENABLED_KEY, nativemap.get(ServiceConstants.HELLO_HASH_ENABLED_KEY)); + nativemap.put(ServiceConstants.NOT_SUPP_WARNING_KEY, nativemap.get(ServiceConstants.NOT_SUPP_WARNING_KEY)); + nativemap.put(ServiceConstants.TLS_KEY, nativemap.get(ServiceConstants.TLS_KEY)); + nativemap.put(ServiceConstants.TLS_PORT_KEY, nativemap.get(ServiceConstants.TLS_PORT_KEY)); + nativemap.put(ServiceConstants.CERTIFICATE_KEY, nativemap.get(ServiceConstants.CERTIFICATE_KEY)); + nativemap.put(ServiceConstants.CALIST_KEY, nativemap.get(ServiceConstants.CALIST_KEY)); + nativemap.put(ServiceConstants.TLS_ENABLE_KEY, nativemap.get(ServiceConstants.TLS_ENABLE_KEY)); + nativemap.put(ServiceConstants.METHOD_KEY, nativemap.get(ServiceConstants.METHOD_KEY)); + nativemap.put(ServiceConstants.TIMEOUT_KEY, nativemap.get(ServiceConstants.TIMEOUT_KEY)); + nativemap.put(ServiceConstants.TLS_PASSWORD_KEY, nativemap.get(ServiceConstants.TLS_PASSWORD_KEY)); + nativemap.put(ServiceConstants.PRIVATE_KEY_KEY, nativemap.get(ServiceConstants.PRIVATE_KEY_KEY)); + nativemap.put(ServiceConstants.REQUIRE_CERTIF_KEY, nativemap.get(ServiceConstants.REQUIRE_CERTIF_KEY)); + nativemap.put(ServiceConstants.SERVER_KEY, nativemap.get(ServiceConstants.SERVER_KEY)); + nativemap.put(ServiceConstants.VERIFY_CLIENT_KEY, nativemap.get(ServiceConstants.VERIFY_CLIENT_KEY)); + nativemap.put(ServiceConstants.VERIFY_SERVER_KEY, nativemap.get(ServiceConstants.VERIFY_SERVER_KEY)); + nativemap.put(ServiceConstants.STUN_ENABLED_KEY, nativemap.get(ServiceConstants.STUN_ENABLED_KEY)); + nativemap.put(ServiceConstants.STUN_SERVER_KEY, nativemap.get(ServiceConstants.STUN_SERVER_KEY)); + nativemap.put(ServiceConstants.CRED_KEY, nativemap.get(ServiceConstants.CRED_KEY)); + + return nativemap; + } }; /**