Skip to content

Users & Telepresence

zjn0505 edited this page Jan 18, 2023 · 20 revisions

User & Telepresence

In this page we will outline all the SDK methods that are related to temi users and telepresence. temi users are people who have a temi account, this means they have downloaded the mobile app, registered and that now you can call them from temi.


API Overview

Return Method Description
List<UserInfo> getAllContact() Get all contacts of temi
UserInfo getAdminInfo() Get administrator information of temi
String startTelepresence(String displayName, String peerId, Platform platform) Start a telepresence
int stopTelepresence() Stop ongoing telepresence
List<RecentCallModel> getRecentCalls() Get recent call records
List<MemberStatusModel> getMembersStatus() Get the availability of temi members(Administrator, Owners)
Pair<Int, String> createLinkBasedMeeting(LinkBasedMeeting linkBasedMeeing) Create a link based meeting
Abstract Class Description
OnUsersUpdatedListener Listener of users information updated
OnTelepresenceStatusChangedListener Listener of telepresence status changed
Interface Description
OnTelepresenceEventChangedListener Listener of telepresence event changed
Model Description
UserInfo User information
RecentCallModel Recent call record
CallState Call state
CallEventModel Call video
Platform User platform
MemberStatusModel Availability of temi members(Administrator, Owners)
LinkBasedMeeting Link based meeting entity

Methods

getAllContact()

Use this method to fetch all the temi contacts that are synced with the launcher. These contacts are saved on the admin's mobile device and are registered to the temi service.

  • Return

    Type Description
    List<UserInfo> List of temi contacts' user information
  • Prototype

    List<UserInfo> getAllContact();
  • Required permissions

    None.

  • Support from

    0.10.36


getAdminInfo()

Use this method to fetech temi's admin user information, this information can be used for many things but mainly it's useful to make calls from temi to the admin's mobile device.

  • Return

    Type Description
    UserInfo User information of administrator
  • Prototype

    UserInfo getAdminInfo();
  • Required permissions

    None.

  • Support from

    0.10.36


startTelepresence()

Use this method to initiate a telepresence session using the temi telepresence service to one of the admin's temi contacts.

  • Parameters

    Parameter Type Description
    String displayName String value of the name of the person you want to call
    String peerId String value of the id of the person you want to call
    Platform platform The target platform you want to make a video call. You can make a video call to the temi App of any contact, but you can only make a video call to the administrator or the owner’s temi center
  • Return

    Type Description
    String -
  • Prototype

    String startTelepresence(String displayName, String peerId, Platform platform);
  • Required permissions

    None.

  • Support from

    0.10.36


stopTelepresence()

Use this method to stop ongoing telepresence session.

  • Parameters

    None.

  • Return

    Type Description
    int 200 OK
    400 failed to verify package name
    403 meeting permission required
    404 No onging telepresence
    500 SDK internal error
  • Prototype

    int stopTelepresence();
  • Required permissions

    Meetings

  • Support from

    1.130.1


getRecentCalls()

Using this method to get the recent call records.

  • Return

    Type Description
    List<RecentCallModel> List of recent call records
  • Prototype

    List<RecentCallModel> getRecentCalls();
  • Required permissions

    None.

  • Support from

    0.10.36


getMembersStatus()

Using this method to get the availability of temi members(Administrator, Owners). Generally used to determine whether video calls can be made.

  • Return

    Type Description
    List<MemberStatusModel> List of temi members' availability status
  • Prototype

    List<MemberStatusModel> getMembersStatus();
  • Required permissions

    None.

  • Support from

    0.10.72


createLinkBasedMeeting()

Using this method to create a link based meeting, with the same functionalities as on temi mobile and temi center.

  • Return

    Type Description
    Pair<int, String> response code and meeting link or error reason.
    200 OK, with meeting link like https://center.robotemi.com/meetings/{linkId}
    403, Meetings permission required.
    429, request too frequently, shall be 5 seconds interval
  • Prototype

Pair<int, String> createLinkBasedMeeting(LinkBasedMeeting linkbasedMeeting);


- **Required permissions**

Meetings.

- **Support from**

1.130.0

<br>

## Abstract Classes

### OnUsersUpdatedListener

Listener for temi contacts changes. Every time one of the admin's contacts makes a change to his info, or is added or deleted from the contact's list the listener will be triggered.

#### Prototype

``` java
package com.robotemi.sdk.listeners;

abstract class OnUsersUpdatedListener {}

Attributes

Attribute Type Description
userIds List<String> List of temi contacts' ID

Abstract methods

  • Parameters

    Parameter Type Description
    user UserInfo The user information that has been changed
  • Prototype

    void onUserUpdated(UserInfo user);

Method for adding listener

  • Parameters

    Parameter Type Description
    listener OnUsersUpdatedListener The object of the child class of this class
  • Prototype

    void addOnUsersUpdatedListener(OnUsersUpdatedListener listener);

Method for removing listener

  • Parameters

    Parameter Type Description
    listener OnUsersUpdatedListener The object of the child class of this class
  • Prototype

    void removeOnUsersUpdatedListener(OnUsersUpdatedListener listener);

OnTelepresenceStatusChangedListener

Listener for telepresence status changes. By adding this listener you will mainly know if the call has started, ended or declined.

From 129 version, sessionId is not required, set sessionId="" is enough, status all telepresence calls can be monitored from this callback.

Prototype

package com.robotemi.sdk.listeners;

abstract class OnTelepresenceStatusChangedListener {}

Attributes

Attribute Type Description
sessionId String Session ID

Abstract methods

  • Parameters

    Parameter Type Description
    callState CallState State of the call
  • Prototype

void onTelepresenceStatusChanged(CallState callState);

Method for adding listener

  • Parameters

    Parameter Type Description
    listener OnTelepresenceStatusChangedListener The object of the child class of this class
  • Prototype

    void addOnTelepresenceStatusChangedListener(OnTelepresenceStatusChangedListener listener);

Method for removing listener

  • Parameters

    Parameter Type Description
    listener OnTelepresenceStatusChangedListener The object of the child class of this class
  • Prototype

    void removeOnTelepresenceStatusChangedListener(OnTelepresenceStatusChangedListener listener);

Interfaces

OnTelepresenceEventChangedListener

Listener for telepresence status changes. Through this listener you can listen to all incoming (start and end) and outgoing (start and end) events.

Prototype

package com.robotemi.sdk.listeners;

interface OnTelepresenceEventChangedListener {}

Abstract methods

  • Parameters

    Parameters Type Description
    callEventModel callEventModel Call event
  • Prototype

    void onTelepresenceEventChanged(CallEventModel calleventModel);

Method for adding listener

  • Parameters

    Parameter Type Description
    listener OnTelepresenceEventChangedListener The object of the class implements this listener interface
  • Prototype

    void addOnTelepresenceEventChangedListener(OnTelepresenceEventChangedListener listener);

Method for removing listener

  • Parameters

    Parameter Type Description
    listener OnTelepresenceEventChangedListener The object of the class implements this listener interface
  • Prototype

    void removeOnTelepresenceEventChangedListener(OnTelepresenceEventChangedListener listener);

Models

UserInfo

Object used to hold the information of user.

Prototype

package com.robotemi.sdk;

class UserInfo {}

Attributes

Attribute Type Description
userId String ID of user
name String Name of user
picUrl String Avatar picture URL of user
role int Role of user, 0 means administrator, 1 means owner, 2 means contact.
From 1.129.1 version, 0 means administrators of robot, 1 means collaborators, 2 means guest, 3 means contacts assigned to this robot, who are temi registered user, and can be called. 10 means contacts assigned to this robot, but only used for face recognition, cannot be called with [UserInfo.userId]

CallState

Used to hold the call state.

Prototype

package com.robotemi.sdk.telepresence;

class CallState {}

Attributes

Attribute Type Description
sessionId String Unique id for the telepresence call
state State Call state

State

Used to hold the state of telepresence call.

Prototype

package com.robotemi.sdk.telepresence.CallState;

enum State {
    ENDED,  // A call has ended
    DECLINED,  // A call attempt was declined by the other callee
    STARTED,  // Call was accepted by the callee and has started
    // The following states are added in 1.129.1 version
    INITIALIZED, // Call is made but not answered yet.
    NOT_ANSWERED, // The other side doesn't answer the call.
    BUSY, // The other side is busy.
    POOR_CONNECTION, // Cannot establish the call due to connection issue.
    CANT_JOIN, // Cannot join the call.
}

CallEventModel

Used to hold the call event.

Prototype

package com.robotemi.sdk.model;

class CallEventModel {}

Attributes

Attribute Type Description
sessionId String Unique id for the telepresence call
type int Type of the call, incoming(0) or outgoing(1)
state int State of the call, started(0) or ended(1)

Static constants

Constant Type Value Description
TYPE_INCOMING int 0 Incoming call
TYPE_OUTGOING int 1 Outgoing call
STATE_STARTED int 0 Call started
STATE_ENDED int 1 Call ended

Platform

Type of temi clients.

Prototype

package com.robotemi.sdk.constants;

enum Platform {
    MOBILE,  // temi mobile App
    TEMI_CENTER  // temi Center
}

MemberStatusModel

Used to hold the temi member's availability status information.

Prototype

package com.robotemi.sdk.model;

class MemberStatusModel {}

Attributes

Attribute Type Description
memberId String ID of temi member
mobileStatus int Availability status of member in temi mobile App
centerStatus int Availability status of member in temi Center

Static constants

Constant Type Value Description
STATUS_ONLINE int 0 Online and available
STATUS_OFFLINE int 1 Offline
STATUS_BUSY int 2 Busy

LinkBasedMeeting

Link based meeting entity

Prototype

package com.robotemi.sdk.telepresence;

class LinkBasedMeeting {}

Attributes

Attribute Type Description
topic String Topic for the meeting
availability Availability Link availablity time range. Define start/end time of the link, or always available
limit Limit Call duration limitation, and usage time limitation
permission Permission Define the link users' permission to control the robot, or create notes.
security Security Set passcode for the meeting
Clone this wiki locally