Rate this page:

IClient

Interface that provides API to connect and login to the Voximplant cloud, and make and receive audio and video calls.

Methods

call

Copy URL

ICall

call(

String

number,

CallSettings

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:

    CallSettings

    Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.

Returns

callConference

Since ver. 2.6.0
Copy URL

ICall

callConference(

String

number,

CallSettings

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:

    CallSettings

    Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.

Returns

connect

Copy URL

void

connect(

Node

node
)

Connects to the Voximplant cloud. Connectivity check is disabled.

Parameters

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

Copy URL

void

connect(

Node

node,

boolean

connectivityCheck,

List<String>

gateways
)

Connects to the Voximplant cloud with additional configuration.

Parameters

  • node:

    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

Copy URL

void

disconnect()

Closes connection to the Voximplant cloud.

Returns

  • type:

    void

getClientState

Copy URL

ClientState

getClientState()

Gets the current client state.

Returns

getSupportedVideoCodecs

Copy URL

List<String>

getSupportedVideoCodecs()

Gets all video codecs supported on this device.

Returns

  • type:

    List<String>

handlePushNotification

Copy URL

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

Copy URL

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

Copy URL

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

Copy URL

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

Copy URL

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

Copy URL

void

registerForPushNotifications(

String

pushRegistrationToken,

IPushTokenCompletionHandler

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:

    IPushTokenCompletionHandler

    Object to receive the result of this operation.

Returns

  • type:

    void

requestOneTimeKey

Copy URL

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

Copy URL

void

setClientIncomingCallListener(

IClientIncomingCallListener

incomingCallListener
)

Sets an IClientIncomingCallListener to handle incoming calls.

Parameters

  • incomingCallListener:

    IClientIncomingCallListener

    IClientIncomingCallListener listener or null. If null, previously set listener is to be removed.

Returns

  • type:

    void

setClientLoginListener

Copy URL

void

setClientLoginListener(

IClientLoginListener

loginListener
)

Sets an IClientLoginListener listener to handle login events.

Parameters

  • loginListener:

    IClientLoginListener

    IClientLoginListener listener or null. If null, previously set listener is to be removed.

Returns

  • type:

    void

setClientSessionListener

Copy URL

void

setClientSessionListener(

IClientSessionListener

sessionListener
)

Sets an IClientSessionListener listener to handle connection to the Voximplant cloud's events.

Parameters

  • sessionListener:

    IClientSessionListener

    IClientSessionListener listener or null. If null, previously set listener is to be removed.

Returns

  • type:

    void

unregisterFromPushNotifications

Copy URL

void

unregisterFromPushNotifications(

String

pushRegistrationToken,

IPushTokenCompletionHandler

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:

    IPushTokenCompletionHandler

    Object to receive the result of this operation.

Returns

  • type:

    void