IClient
Interface that provides API to connect and login to the Voximplant cloud, and make and receive audio and video calls.
Methods
call
call(String
number, callSettings)
Creates a new call instance. Call should be then started.
Parameters
number:
String
SIP URI, username or phone number to make call to. Actual routing is then performed by VoxEngine scenario
callSettings:
Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.
Returns
type:
callConference
callConference(String
number, callSettings)
Creates a call to a dedicated conference without proxy session. For details see the video conferencing guide
Parameters
number:
String
The number to call. For SIP compatibility reasons it should be a non-empty string even if the number itself is not used by a Voximplant cloud scenario.
callSettings:
Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.
Returns
type:
connect
void
connect( node)
Connects to the Voximplant cloud. Connectivity check is disabled.
Parameters
node:
Node the Voximplant account belongs to (since 2.39.0). Find more information about Node in the getting started guide.
Returns
type:
void
Throws
IllegalArgumentException If node is null.
IllegalStateException If the connection is currently establishing or already established. Use IClient.getClientState() to check the current state (since 2.3.2).
connect
void
connect( node, boolean
connectivityCheck, List<String>
gateways)
Connects to the Voximplant cloud with additional configuration.
Parameters
node:
Node the Voximplant account belongs to (since 2.39.0). Find more information about Node in the getting started guide.
connectivityCheck:
boolean
Checks whether UDP traffic flows correctly between device and the Voximplant cloud. This check reduces connection speed.
gateways:
List<String>
List of server names of particular media gateways for connection
Returns
type:
void
Throws
IllegalArgumentException If node is null.
IllegalStateException If the connection is currently establishing or already established. Use IClient.getClientState() to check the current state (since 2.3.2).
disconnect
void
disconnect()
Closes connection to the Voximplant cloud.
Returns
type:
void
getSupportedVideoCodecs
List<String>
getSupportedVideoCodecs()
Gets all video codecs supported on this device.
Returns
type:
List<String>
handlePushNotification
void
handlePushNotification(Map<String, String>
notification)
Handles an incoming push notification.
Parameters
notification:
Map<String, String>
Incoming push notification that comes from FirebaseMessagingService.onMessageReceived(RemoteMessage remoteMessage)
Returns
type:
void
login
void
login(String
user, String
password)
Logs in to the specified Voximplant application with a password.
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
password:
String
User password
Returns
type:
void
loginWithAccessToken
void
loginWithAccessToken(String
user, String
accessToken)
Performs a login via the specified username and the access token that has been obtained in the IClientLoginListener.onLoginSuccessful(String, AuthParams) callback before.
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
accessToken:
String
Access token that has been obtained in onLoginSuccessful callback
Returns
type:
void
loginWithOneTimeKey
void
loginWithOneTimeKey(String
user, String
hash)
Performs a login via one-time key that has been generated before
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
hash:
String
Hash that has been generated via the following formula: MD5(oneTimeKey+"|"+MD5(user+":voximplant.com:"+password))
Returns
type:
void
refreshToken
void
refreshToken(String
user, String
refreshToken)
Performs a login tokens refresh required for login via access token.
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
refreshToken:
String
Refresh token that has been obtained in onLoginSuccessful callback
Returns
type:
void
registerForPushNotifications
void
registerForPushNotifications(String
pushRegistrationToken, completionHandler)
Registers for push notifications. Application can receive push notifications from the Voximplant cloud after the first login.
The API can be called in any IClient state, but the push token is registered only after a successful login.
Parameters
pushRegistrationToken:
String
FCM registration token that can be retrieved by calling FirebaseInstanceID.getToken()
completionHandler:
Object to receive the result of this operation.
Returns
type:
void
requestOneTimeKey
void
requestOneTimeKey(String
user)
Generates one time login key to be used for automated login process.
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
Returns
type:
void
setClientIncomingCallListener
void
setClientIncomingCallListener( incomingCallListener)
Sets an IClientIncomingCallListener to handle incoming calls.
Parameters
incomingCallListener:
IClientIncomingCallListener listener or null. If null, previously set listener is to be removed.
Returns
type:
void
setClientLoginListener
void
setClientLoginListener( loginListener)
Sets an IClientLoginListener listener to handle login events.
Parameters
loginListener:
IClientLoginListener listener or null. If null, previously set listener is to be removed.
Returns
type:
void
setClientSessionListener
void
setClientSessionListener( sessionListener)
Sets an IClientSessionListener listener to handle connection to the Voximplant cloud's events.
Parameters
sessionListener:
IClientSessionListener listener or null. If null, previously set listener is to be removed.
Returns
type:
void
unregisterFromPushNotifications
void
unregisterFromPushNotifications(String
pushRegistrationToken, completionHandler)
Unregisters from push notifications. Application no longer receives push notifications from the Voximplant cloud.
The API may be called in any IClient state, but the push token is unregistered only after a successful login.
Parameters
pushRegistrationToken:
String
FCM registration token that has been used to register for push notifications
completionHandler:
Object to receive the result of this operation.
Returns
type:
void