Rate this page:

IClient

Interface that may be used to connect and login to Voximplant Cloud, and make and receive audio and video calls.

Methods

call

Copy URL

ICall

call(

String

number,

CallSettings

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:

    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
)

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:

    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
)

Connect 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 current state (since 2.3.2).

connect

Copy URL

void

connect(

Node

node,

boolean

connectivityCheck,

List<String>

gateways
)

Connect 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 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

Copy URL

void

disconnect()

Closes connection with the Voximplant Cloud.

Returns

  • type:

    void

getClientState

Copy URL

ClientState

getClientState()

Get current client state

Returns

getSupportedVideoCodecs

Copy URL

List<String>

getSupportedVideoCodecs()

Get all video codecs supported on this device

Returns

  • type:

    List<String>

handlePushNotification

Copy URL

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

Copy URL

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

Copy URL

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

Copy URL

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

Copy URL

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

Copy URL

void

registerForPushNotifications(

String

pushRegistrationToken,

IPushTokenCompletionHandler

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:

    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
)

Set IClientIncomingCallListener to handle incoming calls.

Parameters

  • incomingCallListener:

    IClientIncomingCallListener

    IClientIncomingCallListener listener or null. If null, previously set listener will be removed.

Returns

  • type:

    void

setClientLoginListener

Copy URL

void

setClientLoginListener(

IClientLoginListener

loginListener
)

Set IClientLoginListener listener to handle login events.

Parameters

  • loginListener:

    IClientLoginListener

    IClientLoginListener listener or null. If null, previously set listener will be removed.

Returns

  • type:

    void

setClientSessionListener

Copy URL

void

setClientSessionListener(

IClientSessionListener

sessionListener
)

Set IClientSessionListener listener to handle connection with Voximplant Cloud events.

Parameters

  • sessionListener:

    IClientSessionListener

    IClientSessionListener listener or null. If null, previously set listener will be removed.

Returns

  • type:

    void

unregisterFromPushNotifications

Copy URL

void

unregisterFromPushNotifications(

String

pushRegistrationToken,

IPushTokenCompletionHandler

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:

    IPushTokenCompletionHandler

    Object to receive the result of this operation.

Returns

  • type:

    void