Package org.linphone.core
Interface AccountManagerServices
public interface AccountManagerServices
Creates and manage SIP user accounts remotely, using the REST API of the
Flexisip Account Manager.
see: https://gitlab.linphone.org/BC/public/flexisip-account-manager
Flexisip Account Manager.
see: https://gitlab.linphone.org/BC/public/flexisip-account-manager
-
Method Summary
Modifier and TypeMethodDescriptioncreateDeleteDeviceRequest
(Address sipIdentity, AccountDevice device) Requests to delete a device from the list of currently known devices.Requests a an account creation request token that once validated using the URL
returned by this method upon success, will allow you to callcreateGetAccountCreationTokenFromRequestTokenRequest(java.lang.String)
to obtain a valid account creation token.createGetAccountCreationTokenFromRequestTokenRequest
(String requestToken) Converts an account creation request token obtained by
linphone_account_manager_services_request_account_creation_request_token to an
account creation token.createGetDevicesListRequest
(Address sipIdentity) Requests the list of devices currently known.createLinkEmailToAccountUsingCodeRequest
(Address sipIdentity, String code) Validates the link between an email address and an account using a code
received by email after callingcreateSendEmailLinkingCodeByEmailRequest(org.linphone.core.Address, java.lang.String)
createLinkPhoneNumberToAccountUsingCodeRequest
(Address sipIdentity, String code) Validates the link between a phone number and an account using a code received
by SMS after callingcreateSendPhoneNumberLinkingCodeBySmsRequest(org.linphone.core.Address, java.lang.String)
createNewAccountUsingTokenRequest
(String username, String password, String algorithm, String token) Creates an account using an account creation token, for example obtained using
createSendAccountCreationTokenByPushRequest(java.lang.String, java.lang.String, java.lang.String)
.createSendAccountCreationTokenByPushRequest
(String pnProvider, String pnParam, String pnPrid) Requests a push notification to be sent to device, containing a valid account
creation token.createSendEmailLinkingCodeByEmailRequest
(Address sipIdentity, String emailAddress) Requests a code to be sent to a given email address, that can be used later to
associate said email to an account usingcreateLinkEmailToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)
.createSendPhoneNumberLinkingCodeBySmsRequest
(Address sipIdentity, String phoneNumber) Requests a code to be sent to a given phone number, that can be used later to
associate said phone number to an account usingcreateLinkPhoneNumberToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)
.Gets the configurer preferred language, if set.long
Gets the native pointer used by this class to make native method calls.Gets the object stored in this object user's datavoid
setLanguage
(String language) Sets the preferred language to get error messages from account manager (if
supported, otherwise will be english).void
setUserData
(Object data) Sets the object to store in this object user's datatoString()
-
Method Details
-
getLanguage
Gets the configurer preferred language, if set.
- Returns:
- the language previously set, if any (otherwise null).
-
setLanguage
Sets the preferred language to get error messages from account manager (if
supported, otherwise will be english).
- Parameters:
language
- The language (en, fr, etc...) you'd like to have error messages
in (if possible).
-
createDeleteDeviceRequest
@NonNull AccountManagerServicesRequest createDeleteDeviceRequest(@NonNull Address sipIdentity, @NonNull AccountDevice device) Requests to delete a device from the list of currently known devices.
- Parameters:
sipIdentity
- the SIP identity URI that identifies your account for which
you want the devices list.device
- theAccountDevice
to delete.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createGetAccountCreationRequestTokenRequest
Requests a an account creation request token that once validated using the URL
returned by this method upon success, will allow you to callcreateGetAccountCreationTokenFromRequestTokenRequest(java.lang.String)
to obtain a valid account creation token.
Once the account creation token is obtained, you can callcreateNewAccountUsingTokenRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createGetAccountCreationTokenFromRequestTokenRequest
@NonNull AccountManagerServicesRequest createGetAccountCreationTokenFromRequestTokenRequest(@NonNull String requestToken) Converts an account creation request token obtained by
linphone_account_manager_services_request_account_creation_request_token to an
account creation token.
The obtained token can be used to callcreateNewAccountUsingTokenRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
.- Parameters:
requestToken
- the token obtained previously and validated using your web
browser.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createGetDevicesListRequest
Requests the list of devices currently known.
- Parameters:
sipIdentity
- the SIP identity URI that identifies your account for which
you want the devices list.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createLinkEmailToAccountUsingCodeRequest
@NonNull AccountManagerServicesRequest createLinkEmailToAccountUsingCodeRequest(@NonNull Address sipIdentity, @NonNull String code) Validates the link between an email address and an account using a code
received by email after callingcreateSendEmailLinkingCodeByEmailRequest(org.linphone.core.Address, java.lang.String)
- Parameters:
sipIdentity
- the SIP identity URI that identifies the account to which
you want to link the email address to.code
- the code received by email.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createLinkPhoneNumberToAccountUsingCodeRequest
@NonNull AccountManagerServicesRequest createLinkPhoneNumberToAccountUsingCodeRequest(@NonNull Address sipIdentity, @NonNull String code) Validates the link between a phone number and an account using a code received
by SMS after callingcreateSendPhoneNumberLinkingCodeBySmsRequest(org.linphone.core.Address, java.lang.String)
- Parameters:
sipIdentity
- the SIP identity URI that identifies the account to which
you want to link the phone number to.code
- the code received by SMS.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createNewAccountUsingTokenRequest
@NonNull AccountManagerServicesRequest createNewAccountUsingTokenRequest(@NonNull String username, @NonNull String password, @NonNull String algorithm, @NonNull String token) Creates an account using an account creation token, for example obtained using
createSendAccountCreationTokenByPushRequest(java.lang.String, java.lang.String, java.lang.String)
.
- Parameters:
username
- the username of the newly created account.password
- the password to use for the newly created account.algorithm
- the algorithm to use to hash the password (must be either MD5
or SHA-256).token
- the account creation token obtained previously.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createSendAccountCreationTokenByPushRequest
@NonNull AccountManagerServicesRequest createSendAccountCreationTokenByPushRequest(@NonNull String pnProvider, @NonNull String pnParam, @NonNull String pnPrid) Requests a push notification to be sent to device, containing a valid account
creation token.
Provider, param & prid can be obtained fromCore.getPushNotificationConfig()
, but on iOS may need some modifications (depending on debug mode for example).
Once the token is obtained, you can callcreateNewAccountUsingTokenRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
.- Parameters:
pnProvider
- The provider, for example "apns.dev".pnParam
- The parameters, for example
"ABCD1234.org.linphone.phone.remote".pnPrid
- The prid, also known as push token.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createSendEmailLinkingCodeByEmailRequest
@NonNull AccountManagerServicesRequest createSendEmailLinkingCodeByEmailRequest(@NonNull Address sipIdentity, @NonNull String emailAddress) Requests a code to be sent to a given email address, that can be used later to
associate said email to an account usingcreateLinkEmailToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)
.
- Parameters:
sipIdentity
- the SIP identity URI that identifies the account to which
you want to link the email address to.emailAddress
- the email address to which to send the code to.- Returns:
- the
AccountManagerServicesRequest
request object.
-
createSendPhoneNumberLinkingCodeBySmsRequest
@NonNull AccountManagerServicesRequest createSendPhoneNumberLinkingCodeBySmsRequest(@NonNull Address sipIdentity, @NonNull String phoneNumber) Requests a code to be sent to a given phone number, that can be used later to
associate said phone number to an account usingcreateLinkPhoneNumberToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)
.
- Parameters:
sipIdentity
- the SIP identity URI that identifies the account to which
you want to link the phone number to.phoneNumber
- the phone number to which to send the code by SMS.- Returns:
- the
AccountManagerServicesRequest
request object.
-
setUserData
Sets the object to store in this object user's data- Parameters:
data
- the object to store
-
getUserData
Object getUserData()Gets the object stored in this object user's data- Returns:
- the object store if any, null otherwise
-
getNativePointer
long getNativePointer()Gets the native pointer used by this class to make native method calls.- Returns:
- the nativer pointer, as long
-
toString
String toString()
-