IClient
Interface that may be used to connect and login to Voximplant Cloud, and make and receive audio and video calls.
Methods
call
ICall call(String number, CallSettings callSettings)
Create a new call instance. Call must be then started using
Parameters
number:
StringSIP URI, username or phone number to make call to. Actual routing is then performed by VoxEngine scenario
callSettings:
CallSettingsCall settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.
Returns
Return:
ICallICall instance or null if the client is not logged in
callConference
Since 2.6.0ICall callConference(String number, CallSettings callSettings)
Create call to a dedicated conference without proxy session. For details see the video conferencing guide
Parameters
number:
StringThe 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:
CallSettingsCall settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.
Returns
Return:
ICallICall instance or null if the client is not logged in
connect
void connect()
Connect to the Voximplant cloud. Connectivity check is disabled.
Throws
тип:
IllegalStateException If the connection is currently establishing or already established. Use IClient.getClientState() to check current state (since 2.3.2).
connect
void connect(boolean connectivityCheck, List<String> gateways)
Connect to the Voximplant cloud with additional configuration.
Parameters
connectivityCheck:
booleanChecks 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
Throws
тип:
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 Voximplant Cloud.
getClientState
ClientState getClientState()
Get current client state
Returns
Return:
ClientStateCurrent client state
getSupportedVideoCodecs
List<String> getSupportedVideoCodecs()
Get all video codecs supported on this device
Returns
Return:
List<String>List of video codec names, for example VP8, H264, VP9
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)
login
void login(String user, String password)
Login to specified Voximplant application with password.
Parameters
user:
StringFull user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
password:
StringUser password
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:
StringFull user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
accessToken:
StringAccess token that was obtained in onLoginSuccessful callback
loginWithOneTimeKey
void loginWithOneTimeKey(String user, String hash)
Perform login using one time key that was generated before
Parameters
user:
StringFull user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
hash:
StringHash that was generated using following formula: MD5(oneTimeKey+"|"+MD5(user+":voximplant.com:"+password)).
Please note that here user is just a user name, without app name, account name or anything else after "@".
So if you pass myuser@myapp.myacc.voximplant.com as a username, you should only use myuser while computing this hash.
refreshToken
void refreshToken(String user, String refreshToken)
Perform refresh of login tokens required for login using access token.
Parameters
user:
StringFull user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
refreshToken:
StringRefresh token that was obtained in onLoginSuccessful callback
registerForPushNotifications
void registerForPushNotifications(String pushRegistrationToken)
Register for push notifications. Application will receive push notifications from Voximplant Server after first log in.
Parameters
pushRegistrationToken:
StringFCM registration token that can be retrieved by calling FirebaseInstanceID.getToken()
requestOneTimeKey
void requestOneTimeKey(String user)
Generates one time login key to be used for automated login process.
Parameters
user:
StringFull user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
setClientIncomingCallListener
void setClientIncomingCallListener(IClientIncomingCallListener incomingCallListener)
Set IClientIncomingCallListener to handle incoming calls.
Parameters
incomingCallListener:
IClientIncomingCallListenerIClientIncomingCallListener listener or null. If null, previously set listener will be removed.
setClientLoginListener
void setClientLoginListener(IClientLoginListener loginListener)
Set IClientLoginListener listener to handle login events.
Parameters
loginListener:
IClientLoginListenerIClientLoginListener listener or null. If null, previously set listener will be removed.
setClientSessionListener
void setClientSessionListener(IClientSessionListener sessionListener)
Set IClientSessionListener listener to handle connection with Voximplant Cloud events.
Parameters
sessionListener:
IClientSessionListenerIClientSessionListener listener or null. If null, previously set listener will be removed.
unregisterFromPushNotifications
void unregisterFromPushNotifications(String pushRegistrationToken)
Unregister from push notifications. Application will no longer receive push notifications from Voximplant server.
Parameters
pushRegistrationToken:
StringFCM registration token that was used to register for push notifications