SIGN UP
Navigation

IClient

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

Methods

callConference

Since 2.5.0
ICall callConference(String number, VideoFlags videoFlags, String customData)

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.

  • videoFlags:

    VideoFlags

    Specify video settings (send and receive) for the new call

  • customData:

    String

    Optional custom data passed with call. Will be available in VoxEngine scenario

Returns

  • Return:

    ICall

    ICall instance or null if the client is not logged in

ICall callTo(String user, VideoFlags videoFlags, String customData)

Create new call instance. Call must be then started using ICall.start(Map) method.

Parameters

  • user:

    String

    SIP URI, username or phone number to make call to. Actual routing is then performed by VoxEngine scenario

  • videoFlags:

    VideoFlags

    Specify video settings (send and receive) for the new call

  • customData:

    String

    Optional custom data passed with call. Will be available in VoxEngine scenario

Returns

  • Return:

    ICall

    ICall instance or null if the client is not logged in

void connect()

Connect to Voximplant Cloud. Connectivity check is disabled

Throws

  • type:

    IllegalStateException In case if the connection is currently establishing or already established. Use IClient.getClientState() to check current state (since 2.3.2).

void connect(boolean connectivityCheck, List<String> gateways)

Connect to Voximplant Cloud with additional configuration.

Parameters

  • 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

Throws

  • type:

    IllegalStateException In case if the connection is currently establishing or already established. Use IClient.getClientState() to check current state (since 2.3.2).

void disconnect()

Closes connection with Voximplant Cloud.

ClientState getClientState()

Get current client state

Returns

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)

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

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

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)).
    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.

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

void registerForPushNotifications(String pushRegistrationToken)

Register for push notifications. Application will receive push notifications from Voximplant Server after first log in.

Parameters

  • pushRegistrationToken:

    String

    FCM registration token that can be retrieved by calling FirebaseInstanceID.getToken()

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

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.

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.

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.

void unregisterFromPushNotifications(String pushRegistrationToken)

Unregister from push notifications. Application will no longer receive push notifications from Voximplant server.

Parameters

  • pushRegistrationToken:

    String

    FCM registration token that was used to register for push notifications