TeamTalk 4 C-API DLL  Version 4.5A
User Properties

Users can be seen on the server after a successful call to TT_DoLogin. Once logged in a user can send user to user text-messages using TT_DoTextMessage as well as receive broadcast messages. A user cannot send audio and video data to other users until they have joined the same channel. More...

Classes

struct  User
 A struct containing the properties of a user. More...
 
struct  UserStatistics
 Packet reception and data statistics for a user. More...
 
struct  TextMessage
 A struct containing the properties of a text message sent by a user. More...
 

Macros

#define TT_CHANNELS_OPERATOR_MAX   16
 

Typedefs

typedef enum UserType UserType
 The types of users supported. More...
 
typedef UINT32 UserTypes
 A bitmask based on UserType describing the user type. More...
 
typedef enum Subscription Subscription
 A user by default accepts audio, video and text messages from all users. Using subscribtions can, however, change what the local client instance is willing to accept from other users. More...
 
typedef UINT32 Subscriptions
 A bitmask based on Subscription describing which subscriptions are enabled. More...
 
typedef enum UserState UserState
 The possible states for a user. Used for User's uUserState variable. More...
 
typedef UINT32 UserStates
 A bitmask based on UserState indicating a User's current state. More...
 
typedef struct User User
 A struct containing the properties of a user. More...
 
typedef struct UserStatistics UserStatistics
 Packet reception and data statistics for a user. More...
 
typedef enum TextMsgType TextMsgType
 Text message types. More...
 
typedef struct TextMessage TextMessage
 A struct containing the properties of a text message sent by a user. More...
 

Enumerations

enum  UserType { USERTYPE_NONE = 0x0, USERTYPE_DEFAULT = 0x01, USERTYPE_ADMIN = 0x02 }
 The types of users supported. More...
 
enum  Subscription {
  SUBSCRIBE_NONE = 0x0000, SUBSCRIBE_USER_MSG = 0x0001, SUBSCRIBE_CHANNEL_MSG = 0x0002, SUBSCRIBE_BROADCAST_MSG = 0x0004,
  SUBSCRIBE_AUDIO = 0x0008, SUBSCRIBE_VIDEO = 0x0010, SUBSCRIBE_DESKTOP = 0x0020, SUBSCRIBE_CUSTOM_MSG = 0x0040,
  SUBSCRIBE_INTERCEPT_USER_MSG = 0x0100, SUBSCRIBE_INTERCEPT_CHANNEL_MSG = 0x0200, SUBSCRIBE_INTERCEPT_AUDIO = 0x0800, SUBSCRIBE_INTERCEPT_VIDEO = 0x1000,
  SUBSCRIBE_INTERCEPT_DESKTOP = 0x2000, SUBSCRIBE_INTERCEPT_CUSTOM_MSG = 0x4000
}
 A user by default accepts audio, video and text messages from all users. Using subscribtions can, however, change what the local client instance is willing to accept from other users. More...
 
enum  UserState {
  USERSTATE_NONE = 0x00, USERSTATE_TALKING = 0x01, USERSTATE_MUTE = 0x02, USERSTATE_P2P_CONNECTED = 0x04,
  USERSTATE_DESKTOP = 0x08, USERSTATE_VIDEO = 0x10
}
 The possible states for a user. Used for User's uUserState variable. More...
 
enum  TextMsgType { MSGTYPE_USER = 1, MSGTYPE_CHANNEL = 2, MSGTYPE_BROADCAST = 3, MSGTYPE_CUSTOM = 4 }
 Text message types. More...
 

Functions

TEAMTALKDLL_API INT32 TT_GetMyUserID (IN TTInstance *lpTTInstance)
 Get the local client instance's user ID. More...
 
TEAMTALKDLL_API BOOL TT_GetMyUserAccount (IN TTInstance *lpTTInstance, OUT UserAccount *lpUserAccount)
 Get the local client instance's UserAccount. More...
 
TEAMTALKDLL_API UserTypes TT_GetMyUserType (IN TTInstance *lpTTInstance)
 Get the client instance's user type. More...
 
TEAMTALKDLL_API INT32 TT_GetMyUserData (IN TTInstance *lpTTInstance)
 If an account was used in TT_DoLogin then this value will return the nUserData from the UserAccount. More...
 
TEAMTALKDLL_API BOOL TT_GetUser (IN TTInstance *lpTTInstance, IN INT32 nUserID, OUT User *lpUser)
 Get the user with the specified ID. More...
 
TEAMTALKDLL_API BOOL TT_GetUserStatistics (IN TTInstance *lpTTInstance, IN INT32 nUserID, OUT UserStatistics *lpStats)
 Get statistics for data and packet reception from a user. More...
 
TEAMTALKDLL_API BOOL TT_GetUserByUsername (IN TTInstance *lpTTInstance, IN const TTCHAR *szUsername, OUT User *lpUser)
 Get the user with the specified username. More...
 
TEAMTALKDLL_API BOOL TT_GetTextMessage (IN TTInstance *lpTTInstance, IN INT32 nMsgID, IN BOOL bRemoveMsg, OUT TextMessage *lpTextMessage)
 Get a text-message sent by a user. More...
 

Detailed Description

Users can be seen on the server after a successful call to TT_DoLogin. Once logged in a user can send user to user text-messages using TT_DoTextMessage as well as receive broadcast messages. A user cannot send audio and video data to other users until they have joined the same channel.

User Types

A user can either be a default user USERTYPE_DEFAULT or an administrator USERTYPE_ADMIN. A default user has limited rights on the server whereas an administrator can change server properties, create, delete and remove channels as well as move, kick and ban users.

User Interaction

Once a user has joined a channel it is possible to transmit audio and video data to other users. If a user starts talking in the channel the event WM_TEAMTALK_USER_TALKING is posted to the user application and if a video frame is received the event WM_TEAMTALK_USER_VIDEOFRAME is sent to the user application.

User Audio Settings

While in the same channel the user application can change different settings on a user. If e.g. a user's volume is too low the user application can call TT_SetUserVolume to increase the volume. If it's still not loud enough TT_SetUserGainLevel can be called to use software to amplify the volume level.

If on the other hand the user application wants to mute a user TT_SetUserMute can be used for this. Note that muting a user doesn't mean that the client instance will stop receiving audio from that user, it simply means it will not be played. To stop receiving audio from a user the local client instance must ask the server to unsubscribe audio data from the user. This is explained in the next section.

User Subscriptions

When logging on to a server the local client instance will by default subscribe to user messages, channel messages, broadcast messages, audio data and video data from all users. If, however, a client wants to stop receiving e.g. audio from a user, he can call TT_DoUnsubscribe along with the user ID and the SUBSCRIBE_AUDIO-flag to tell the server that he no longer wants to receive audio from that user. The server will then respond with the event WM_TEAMTALK_CMD_USER_UPDATE and the uLocalSubscriptions member of User will have the SUBSCRIBE_AUDIO-flag removed. At the remote user the uPeerSubscriptions member will be changed. Subscribe/unsubscribe can also be done for user, channel and broadcast messages and video data. The function TT_DoSubscribe can be used to revert unsubscriptions.

Spying on Users

Previously it has been said that users can only receive audio and video from users when they are in the same channel, but actually an administrator user can call TT_DoSubscribe with the flags prefixed SUBSCRIBE_INTERCEPT_* to spy on users outside his own channel. In other words it's possible hear and see video data outside ones channel. Also all user and channel messages sent by a user can also be intercepted in this way.

Having the ability to intercept all data sent from users in any channel means that it's possible to log everything that is happening on the server. Both audio and video transfers as well as text messaging. Checkout TT_SetUserAudioFolder on how to store voice data to audio files.

Macro Definition Documentation

#define TT_CHANNELS_OPERATOR_MAX   16

The maximum number of channels where a user can automatically become channel operator.

See Also
UserAccount

Typedef Documentation

typedef enum UserType UserType

The types of users supported.

See Also
User
UserAccount
typedef UINT32 UserTypes

A bitmask based on UserType describing the user type.

See Also
UserType
typedef enum Subscription Subscription

A user by default accepts audio, video and text messages from all users. Using subscribtions can, however, change what the local client instance is willing to accept from other users.

By calling TT_DoSubscribe and TT_DoUnsubscribe the local client instance can tell the server (and thereby remote users) what he is willing to accept from other users.

To check what a user subscribes to check out the User struct's uLocalSubscriptions. The subscriptions with the prefix SUBSCRIBE_INTERCEPT_* options can be used to spy on users and receive data from them even if one is not participating in the same channel as they are.

See Also
TT_DoSubscribe
TT_DoUnsubscribe
typedef UINT32 Subscriptions

A bitmask based on Subscription describing which subscriptions are enabled.

See Also
Subscription
typedef enum UserState UserState

The possible states for a user. Used for User's uUserState variable.

typedef UINT32 UserStates

A bitmask based on UserState indicating a User's current state.

typedef struct User User

A struct containing the properties of a user.

See Also
UserType
TT_GetUser

Packet reception and data statistics for a user.

See Also
TT_GetUserStatistics
typedef enum TextMsgType TextMsgType

Text message types.

The types of messages which can be passed to TT_DoTextMessage().

See Also
TextMessage
TT_DoTextMessage
TT_GetTextMessage
typedef struct TextMessage TextMessage

A struct containing the properties of a text message sent by a user.

See Also
WM_TEAMTALK_CMD_USER_TEXTMSG
TT_DoTextMessage
TT_GetTextMessage

Enumeration Type Documentation

enum UserType

The types of users supported.

See Also
User
UserAccount
Enumerator
USERTYPE_NONE 

Used internally to denote an unauthenticated user.

USERTYPE_DEFAULT 

A default user who can join channels.

USERTYPE_ADMIN 

A user with administrator privileges.

A user by default accepts audio, video and text messages from all users. Using subscribtions can, however, change what the local client instance is willing to accept from other users.

By calling TT_DoSubscribe and TT_DoUnsubscribe the local client instance can tell the server (and thereby remote users) what he is willing to accept from other users.

To check what a user subscribes to check out the User struct's uLocalSubscriptions. The subscriptions with the prefix SUBSCRIBE_INTERCEPT_* options can be used to spy on users and receive data from them even if one is not participating in the same channel as they are.

See Also
TT_DoSubscribe
TT_DoUnsubscribe
Enumerator
SUBSCRIBE_NONE 

No subscriptions.

SUBSCRIBE_USER_MSG 

Subscribing to user text messages.

See Also
MSGTYPE_USER.
SUBSCRIBE_CHANNEL_MSG 

Subscribing to channel texxt messages.

See Also
MSGTYPE_CHANNEL.
SUBSCRIBE_BROADCAST_MSG 

Subscribing to broadcast text messsages.

See Also
MSGTYPE_BROADCAST.
SUBSCRIBE_AUDIO 

Subscribing to audio.

SUBSCRIBE_VIDEO 

Subscribing to video.

SUBSCRIBE_DESKTOP 

Subscribing to desktop sharing.

SUBSCRIBE_CUSTOM_MSG 

Subscribing to custom user messages.

See Also
MSGTYPE_CUSTOM.
SUBSCRIBE_INTERCEPT_USER_MSG 

Intercept all user text messages sent by a user. Only user-type USERTYPE_ADMIN can do this.

SUBSCRIBE_INTERCEPT_CHANNEL_MSG 

Intercept all channel messages sent by a user. Only user-type USERTYPE_ADMIN can do this.

SUBSCRIBE_INTERCEPT_AUDIO 

Intercept all audio sent by a user. Only user-type USERTYPE_ADMIN can do this. By enabling this subscription an administrator can listen to audio sent by users outside his own channel.

SUBSCRIBE_INTERCEPT_VIDEO 

Intercept all video sent by a user. Only user-type USERTYPE_ADMIN can do this. By enabling this subscription an administrator can receive video frames sent by users outside his own channel.

SUBSCRIBE_INTERCEPT_DESKTOP 

Intercept all desktop data sent by a user. Only user-type USERTYPE_ADMIN can do this. By enabling this subscription an administrator can views desktops sent by users outside his own channel.

SUBSCRIBE_INTERCEPT_CUSTOM_MSG 

Intercept all custom text messages sent by user. Only user-type USERTYPE_ADMIN can do this.

enum UserState

The possible states for a user. Used for User's uUserState variable.

Enumerator
USERSTATE_NONE 

The user is in initial state.

USERSTATE_TALKING 

If set the user is currently talking. Basically means the event WM_TEAMTALK_USER_TALKING has been posted for this user. This flag doesn't apply to "myself". For "myself" (client instance) use TT_IsTransmitting.

USERSTATE_MUTE 

If set the user is muted.

See Also
TT_SetUserMute
USERSTATE_P2P_CONNECTED 

Whether a peer to peer connection has been established to this user.

See Also
WM_TEAMTALK_CON_P2P
USERSTATE_DESKTOP 

If set the user currently has an active desktop session.

See Also
TT_SendDesktopWindow().
USERSTATE_VIDEO 

If set the user currently has an active video stream.

See Also
TT_GetUserVideoFrame().

Text message types.

The types of messages which can be passed to TT_DoTextMessage().

See Also
TextMessage
TT_DoTextMessage
TT_GetTextMessage
Enumerator
MSGTYPE_USER 

A User to user text message.

MSGTYPE_CHANNEL 

A User to channel text message.

MSGTYPE_BROADCAST 

A broadcast message. Only admins can send broadcast messages unless USERRIGHT_CLIENT_BROADCAST is enabled.

MSGTYPE_CUSTOM 

A custom user to user text message. Works the same way as MSGTYPE_USER.

Function Documentation

TEAMTALKDLL_API INT32 TT_GetMyUserID ( IN TTInstance lpTTInstance)

Get the local client instance's user ID.

This information can be retrieved after the WM_TEAMTALK_CMD_MYSELF_LOGGEDIN event.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
Returns
Returns the user ID assigned to the current user on the server. -1 is returned if no ID has been assigned to the user.
TEAMTALKDLL_API BOOL TT_GetMyUserAccount ( IN TTInstance lpTTInstance,
OUT UserAccount lpUserAccount 
)

Get the local client instance's UserAccount.

This information can be retrieved after WM_TEAMTALK_CMD_MYSELF_LOGGEDIN event.

Note
Requires server version 4.0.1.970 or later.
Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
lpUserAccountThe local client's user account registered on the server. Note that the szPassword field of UserAccount will not be set.
See Also
TT_DoLogin
TEAMTALKDLL_API UserTypes TT_GetMyUserType ( IN TTInstance lpTTInstance)

Get the client instance's user type.

This information can be retrieved after WM_TEAMTALK_CMD_MYSELF_LOGGEDIN event.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
Returns
A bitmask of the type of user based on UserType.
See Also
TT_GetMyUserAccount
TT_DoLogin
UserType
TEAMTALKDLL_API INT32 TT_GetMyUserData ( IN TTInstance lpTTInstance)

If an account was used in TT_DoLogin then this value will return the nUserData from the UserAccount.

This information can be retrieved after WM_TEAMTALK_CMD_MYSELF_LOGGEDIN event.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
Returns
If set, nUserData from UserAccount, otherwise 0.
See Also
TT_GetMyUserAccount
TEAMTALKDLL_API BOOL TT_GetUser ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
OUT User lpUser 
)

Get the user with the specified ID.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nUserIDThe ID of the user to extract.
lpUserA preallocated User struct.
See Also
TT_GetUserByUsername
TEAMTALKDLL_API BOOL TT_GetUserStatistics ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
OUT UserStatistics lpStats 
)

Get statistics for data and packet reception from a user.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nUserIDThe ID of the user to extract.
lpStatsA preallocated UserStatistics struct.
TEAMTALKDLL_API BOOL TT_GetUserByUsername ( IN TTInstance lpTTInstance,
IN const TTCHAR szUsername,
OUT User lpUser 
)

Get the user with the specified username.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
szUsernameThe user's username (from UserAccount).
lpUserA preallocated User struct.
TEAMTALKDLL_API BOOL TT_GetTextMessage ( IN TTInstance lpTTInstance,
IN INT32  nMsgID,
IN BOOL  bRemoveMsg,
OUT TextMessage lpTextMessage 
)

Get a text-message sent by a user.

The client instance uses a cyclic buffer in order not to drain resources and can hold a maximum of 65535 text-messages.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nMsgIDThe ID of the message to extract.
bRemoveMsgClear the text-message to release resources.
lpTextMessageWill receive the content of the message extracted. Pass NULL if only called to remove the message.