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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      ICall callTo(java.lang.String user, VideoFlags videoFlags, java.lang.String customData)
      Create new call instance.
      void connect()
      Connect to VoxImplant Cloud.
      void connect(boolean connectivityCheck, java.util.List<java.lang.String> gateways)
      Connect to VoxImplant Cloud with addition configuration.
      void disconnect()
      Closes connection with VoxImplant Cloud.
      void handlePushNotification(java.util.Map<java.lang.String,java.lang.String> notification)
      Handle incoming push notification
      void login(java.lang.String user, java.lang.String password)
      Login to specified VoxImplant application with password.
      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.
      void loginWithOneTimeKey(java.lang.String user, java.lang.String hash)
      Perform login using one time key that was generated before
      void refreshToken(java.lang.String user, java.lang.String refreshToken)
      Perform refresh of login tokens required for login using access token.
      void registerForPushNotifications(java.lang.String pushRegistrationToken)
      Register for push notifications.
      void requestOneTimeKey(java.lang.String user)
      Generates one time login key to be used for automated login process.
      void setClientIncomingCallListener(IClientIncomingCallListener incomingCallListener)
      Set IClientIncomingCallListener to handle incoming calls.
      void setClientLoginListener(IClientLoginListener loginListener)
      Set IClientLoginListener listener to handle login events.
      void setClientSessionListener(IClientSessionListener sessionListener)
      Set IClientSessionListener listener to handle connection with VoxImplant Cloud events.
      void unregisterFromPushNotifications(java.lang.String pushRegistrationToken)
      Unregister from push notifications.
    • Method Detail

      • connect

        void connect()
        Connect to VoxImplant Cloud. Connectivity check is disabled
      • connect

        void connect(boolean connectivityCheck, java.util.List<java.lang.String> gateways)
        Connect to VoxImplant Cloud with addition 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
      • 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.