All Classes

com.voximplant.sdk.client

Interface IClient



  • public interface IClient
    Interface that may be used to connect and login to VoxImplant Cloud, and make and receive audio and video calls.
    • Method Detail

      • connect

        void connect() throws java.lang.IllegalStateException
        Connect to VoxImplant Cloud. Connectivity check is disabled
        Throws:
        java.lang.IllegalStateException - In case if the connection is currently establishing or already established. Use getClientState() to check current state (since 2.3.2).
      • connect

        void connect(boolean connectivityCheck, java.util.List<java.lang.String> gateways) throws java.lang.IllegalStateException
        Connect to VoxImplant Cloud with additional configuration.
        Parameters:
        connectivityCheck - Checks whether UDP traffic will flow correctly between device and VoxImplant cloud. This check reduces connection speed.
        gateways - List of server names of particular media gateways for connection
        Throws:
        java.lang.IllegalStateException - In case if the connection is currently establishing or already established. Use getClientState() to check current state (since 2.3.2).
      • disconnect

        void disconnect()
        Closes connection with VoxImplant Cloud.
      • requestOneTimeKey

        void requestOneTimeKey(java.lang.String user)
        Generates one time login key to be used for automated login process.
        Parameters:
        user - Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
      • loginWithOneTimeKey

        void loginWithOneTimeKey(java.lang.String user, java.lang.String hash)
        Perform login using one time key that was generated before
        Parameters:
        user - Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
        hash - 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.
      • loginWithAccessToken

        void loginWithAccessToken(java.lang.String user, java.lang.String accessToken)
        Perform login using specified username and access token that was obtained in onLoginSuccessful callback before.
        Parameters:
        user - Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
        accessToken - Access token that was obtained in onLoginSuccessful callback
      • login

        void login(java.lang.String user, java.lang.String password)
        Login to specified VoxImplant application with password.
        Parameters:
        user - Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
        password - User password
      • refreshToken

        void refreshToken(java.lang.String user, java.lang.String refreshToken)
        Perform refresh of login tokens required for login using access token.
        Parameters:
        user - Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com
        refreshToken - Refresh token that was obtained in onLoginSuccessful callback
      • callTo

        ICall callTo(java.lang.String user, VideoFlags videoFlags, java.lang.String customData)
        Create new call instance. Call must be then started using ICall.start() method.
        Parameters:
        user - SIP URI, username or phone number to make call to. Actual routing is then performed by VoxEngine scenario
        videoFlags - Specify video settings (send and receive) for the new call
        customData - Optional custom data passed with call. Will be available in VoxEngine scenario
        Returns:
        ICall instance
      • handlePushNotification

        void handlePushNotification(java.util.Map<java.lang.String,java.lang.String> notification)
        Handle incoming push notification
        Parameters:
        notification - Incoming push notification that comes from FirebaseMessagingService.onMessageReceived(RemoteMessage remoteMessage)
      • registerForPushNotifications

        void registerForPushNotifications(java.lang.String pushRegistrationToken)
        Register for push notifications. Application will receive push notifications from VoxImplant Server after first log in.
        Parameters:
        pushRegistrationToken - FCM registration token that can be retrieved by calling FirebaseInstanceID.getToken()
      • unregisterFromPushNotifications

        void unregisterFromPushNotifications(java.lang.String pushRegistrationToken)
        Unregister from push notifications. Application will no longer receive push notifications from VoxImplant server.
        Parameters:
        pushRegistrationToken - FCM registration token that was used to register for push notifications
      • setClientSessionListener

        void setClientSessionListener(IClientSessionListener 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.
      • setClientLoginListener

        void setClientLoginListener(IClientLoginListener loginListener)
        Set IClientLoginListener listener to handle login events.
        Parameters:
        loginListener - IClientLoginListener listener or null. If null, previously set listener will be removed.
      • setClientIncomingCallListener

        void setClientIncomingCallListener(IClientIncomingCallListener incomingCallListener)
        Set IClientIncomingCallListener to handle incoming calls.
        Parameters:
        incomingCallListener - IClientIncomingCallListener listener or null. If null, previously set listener will be removed.
      • getClientState

        ClientState getClientState()
        Get current client state
        Returns:
        Current client state