IClient
Interface that may be used to connect and login to Voximplant Cloud, and make and receive audio and video calls.
Methods
call
call(String
number, callSettings)
Create a new call instance. Call must be then started using
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)
Create 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)
Connect 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 current state (since 2.3.2).
connect
void
connect( node, boolean
connectivityCheck, List<String>
gateways)
Connect 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 will flow correctly between device and 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 current state (since 2.3.2).
disconnect
void
disconnect()
Closes connection with the Voximplant Cloud.
Returns
type:
void
getSupportedVideoCodecs
List<String>
getSupportedVideoCodecs()
Get all video codecs supported on this device
Returns
type:
List<String>
handlePushNotification
void
handlePushNotification(Map<String, String>
notification)
Handle 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)
Login to specified Voximplant application with 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)
Perform login using specified username and access token that was obtained in 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 was obtained in onLoginSuccessful callback
Returns
type:
void
loginWithOneTimeKey
void
loginWithOneTimeKey(String
user, String
hash)
Perform login using one time key that was generated before
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
hash:
String
Hash that was generated using following formula: MD5(oneTimeKey+"|"+MD5(user+":voximplant.com:"+password))
Returns
type:
void
refreshToken
void
refreshToken(String
user, String
refreshToken)
Perform refresh of login tokens required for login using access token.
Parameters
user:
String
Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
refreshToken:
String
Refresh token that was obtained in onLoginSuccessful callback
Returns
type:
void
registerForPushNotifications
void
registerForPushNotifications(String
pushRegistrationToken, completionHandler)
Register for push notifications. Application will receive push notifications from Voximplant Server after first log in.
The API may be called in any IClient state, but the push token will be registered only after login successful.
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)
Set IClientIncomingCallListener to handle incoming calls.
Parameters
incomingCallListener:
IClientIncomingCallListener listener or null. If null, previously set listener will be removed.
Returns
type:
void
setClientLoginListener
void
setClientLoginListener( loginListener)
Set IClientLoginListener listener to handle login events.
Parameters
loginListener:
IClientLoginListener listener or null. If null, previously set listener will be removed.
Returns
type:
void
setClientSessionListener
void
setClientSessionListener( sessionListener)
Set IClientSessionListener listener to handle connection with Voximplant Cloud events.
Parameters
sessionListener:
IClientSessionListener listener or null. If null, previously set listener will be removed.
Returns
type:
void
unregisterFromPushNotifications
void
unregisterFromPushNotifications(String
pushRegistrationToken, completionHandler)
Unregister from push notifications. Application will no longer receive push notifications from Voximplant server.
The API may be called in any IClient state, but the push token will be unregistered only after login successful.
Parameters
pushRegistrationToken:
String
FCM registration token that was used to register for push notifications
completionHandler:
Object to receive the result of this operation.
Returns
type:
void