TeamTalk 5 C-API DLL Version 5.18A

Functions
Client/Server Commands

This section contains the list of commands which can be issued by the client instance to the server. More...

## Functions

TEAMTALKDLL_API INT32 | TT_DoPing (IN TTInstance *lpTTInstance)
| Ping server and wait for server to reply. More...
TEAMTALKDLL_API INT32 | TT_DoLogin (IN TTInstance *lpTTInstance, IN const TTCHAR *szNickname, IN const TTCHAR *szUsername, IN const TTCHAR *szPassword)
| Same as TT_DologinEx() but without the option to specify `szClientName`. Kept for backwards compatibility. More...
TEAMTALKDLL_API INT32 | TT_DoLoginEx (IN TTInstance *lpTTInstance, IN const TTCHAR *szNickname, IN const TTCHAR *szUsername, IN const TTCHAR *szPassword, IN const TTCHAR *szClientName)
| Logon to a server. More...
TEAMTALKDLL_API INT32 | TT_DoLogout (IN TTInstance *lpTTInstance)
| Logout of the server. More...
TEAMTALKDLL_API INT32 | TT_DoJoinChannel (IN TTInstance *lpTTInstance, IN const Channel *lpChannel)
| Create a new channel and join it. More...
TEAMTALKDLL_API INT32 | TT_DoJoinChannelByID (IN TTInstance *lpTTInstance, IN INT32 nChannelID, IN const TTCHAR *szPassword)
| Join an existing channel. More...
TEAMTALKDLL_API INT32 | TT_DoLeaveChannel (IN TTInstance *lpTTInstance)
| Leave the current channel. More...
TEAMTALKDLL_API INT32 | TT_DoChangeNickname (IN TTInstance *lpTTInstance, IN const TTCHAR *szNewNick)
| Change the client instance's nick name. More...
TEAMTALKDLL_API INT32 | TT_DoChangeStatus (IN TTInstance *lpTTInstance, IN INT32 nStatusMode, IN const TTCHAR *szStatusMessage)
| Change the client instance's currect status. More...
TEAMTALKDLL_API INT32 | TT_DoTextMessage (IN TTInstance *lpTTInstance, IN const TextMessage *lpTextMessage)
| Send a text message to either a user or a channel. More...
TEAMTALKDLL_API INT32 | TT_DoChannelOp (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nChannelID, IN TTBOOL bMakeOperator)
| Make another user operator of a channel. More...
TEAMTALKDLL_API INT32 | TT_DoChannelOpEx (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nChannelID, IN const TTCHAR *szOpPassword, IN TTBOOL bMakeOperator)
| Make another user operator of a channel using the szOpPassword of Channel. More...
TEAMTALKDLL_API INT32 | TT_DoKickUser (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nChannelID)
| Kick user from either channel or server. More...
TEAMTALKDLL_API INT32 | TT_DoSendFile (IN TTInstance *lpTTInstance, IN INT32 nChannelID, IN const TTCHAR *szLocalFilePath)
| Send a file to the specified channel. More...
TEAMTALKDLL_API INT32 | TT_DoRecvFile (IN TTInstance *lpTTInstance, IN INT32 nChannelID, IN INT32 nFileID, IN const TTCHAR *szLocalFilePath)
| Download a file from the specified channel. More...
TEAMTALKDLL_API INT32 | TT_DoDeleteFile (IN TTInstance *lpTTInstance, IN INT32 nChannelID, IN INT32 nFileID)
| Delete a file from a channel. More...
TEAMTALKDLL_API INT32 | TT_DoSubscribe (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN Subscriptions uSubscriptions)
| Subscribe to user events and/or data. More...
TEAMTALKDLL_API INT32 | TT_DoUnsubscribe (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN Subscriptions uSubscriptions)
| Unsubscribe to user events/data. This can be used to ignore messages or voice data from a specific user. More...
TEAMTALKDLL_API INT32 | TT_DoMakeChannel (IN TTInstance *lpTTInstance, IN const Channel *lpChannel)
| Make a new channel on the server. More...
TEAMTALKDLL_API INT32 | TT_DoUpdateChannel (IN TTInstance *lpTTInstance, IN const Channel *lpChannel)
| Update a channel's properties. More...
TEAMTALKDLL_API INT32 | TT_DoRemoveChannel (IN TTInstance *lpTTInstance, IN INT32 nChannelID)
| Remove a channel from a server. More...
TEAMTALKDLL_API INT32 | TT_DoMoveUser (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nChannelID)
| Issue command to move a user from one channel to another. More...
TEAMTALKDLL_API INT32 | TT_DoUpdateServer (IN TTInstance *lpTTInstance, IN const ServerProperties *lpServerProperties)
| Update server properties. More...
TEAMTALKDLL_API INT32 | TT_DoListUserAccounts (IN TTInstance *lpTTInstance, IN INT32 nIndex, IN INT32 nCount)
| Issue command to list user accounts on the server. More...
TEAMTALKDLL_API INT32 | TT_DoNewUserAccount (IN TTInstance *lpTTInstance, IN const UserAccount *lpUserAccount)
| Issue command to create a new user account on the server. More...
TEAMTALKDLL_API INT32 | TT_DoDeleteUserAccount (IN TTInstance *lpTTInstance, IN const TTCHAR *szUsername)
| Issue command to delete a user account on the server. More...
TEAMTALKDLL_API INT32 | TT_DoBanUser (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nChannelID)
| Issue a ban command on a user. More...
TEAMTALKDLL_API INT32 | TT_DoBanUserEx (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN BanTypes uBanTypes)
| Ban the user with `nUserID` using the ban types specified. More...
TEAMTALKDLL_API INT32 | TT_DoBan (IN TTInstance *lpTTInstance, IN const BannedUser *lpBannedUser)
| Ban the properties specified in `lpBannedUser`. More...
TEAMTALKDLL_API INT32 | TT_DoBanIPAddress (IN TTInstance *lpTTInstance, IN const TTCHAR *szIPAddress, IN INT32 nChannelID)
| Issue a ban command on an IP-address user. More...
TEAMTALKDLL_API INT32 | TT_DoUnBanUser (IN TTInstance *lpTTInstance, IN const TTCHAR *szIPAddress, IN INT32 nChannelID)
| Unban the user with the specified IP-address. More...
TEAMTALKDLL_API INT32 | TT_DoUnBanUserEx (IN TTInstance *lpTTInstance, IN const BannedUser *lpBannedUser)
| Unban the properties specified in BannedUser. More...
TEAMTALKDLL_API INT32 | TT_DoListBans (IN TTInstance *lpTTInstance, IN INT32 nChannelID, IN INT32 nIndex, IN INT32 nCount)
| Issue a command to list the banned users. More...
TEAMTALKDLL_API INT32 | TT_DoSaveConfig (IN TTInstance *lpTTInstance)
| Save the server's current state to its settings file (typically the server's .xml file). More...
TEAMTALKDLL_API INT32 | TT_DoQueryServerStats (IN TTInstance *lpTTInstance)
| Get the server's current statistics. More...
TEAMTALKDLL_API INT32 | TT_DoQuit (IN TTInstance *lpTTInstance)
| Quit from server. More...

## Detailed Description

This section contains the list of commands which can be issued by the client instance to the server.

# Client/Server Command Processing

Functions with the prefix TT_Do* are commands which the client can issue to the server. Every TT_Do* function returns a command identifier which can user application can use to check when the server has finished processing the issued command. Once the client receives a response to a command the client instance posts the event CLIENTEVENT_CMD_PROCESSING to the user application containing the command identifier and whether the command is being processed or it has completed.

As an example, say the user application wants to issue the TT_DoLogin command. When the application calls TT_DoLogin the returned command ID is stored in a variable. The application then waits for the CLIENTEVENT_CMD_PROCESSING event to be posted with the stored command ID. The first time CLIENTEVENT_CMD_PROCESSING is posted to the user application it is to say that processing has begun. The second time CLIENTEVENT_CMD_PROCESSING is called it is to say that the command has completed. In between the command starting and completing several other events may take place. If e.g. the TT_DoLogin fails the user application would receive the event CLIENTEVENT_CMD_ERROR. If on the other hand the command was successful all the channels and user would be posted as events to the application before the login-command completed processing.

## Function Documentation

## ◆ TT_DoPing()

TEAMTALKDLL_API INT32 TT_DoPing | ( | IN TTInstance * | lpTTInstance | ) |

Ping server and wait for server to reply.

Use this command to check if the server is responding.

If the client instance doesn't ping the server within the timeout specified by `nUserTimeout` in ServerProperties, then the server will disconnect the client.

The client instance automatically pings the server at half the time specified by `nUserTimeout` in ServerProperties.

CLIENTEVENT_CMD_PROCESSING is posted if server replies.

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

## ◆ TT_DoLogin()

TEAMTALKDLL_API INT32 TT_DoLogin | ( | IN TTInstance * | lpTTInstance,
|  | IN const TTCHAR * | szNickname,
|  | IN const TTCHAR * | szUsername,
|  | IN const TTCHAR * | szPassword
| ) |  |

Same as TT_DologinEx() but without the option to specify `szClientName`. Kept for backwards compatibility.

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  szNickname | The nickname to use.
  szUsername | The username of the UserAccount set up on the server.
  szPassword | The password of the user account on the server. Leave blank if no account is needed on the server.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

## ◆ TT_DoLoginEx()

TEAMTALKDLL_API INT32 TT_DoLoginEx | ( | IN TTInstance * | lpTTInstance,
|  | IN const TTCHAR * | szNickname,
|  | IN const TTCHAR * | szUsername,
|  | IN const TTCHAR * | szPassword,
|  | IN const TTCHAR * | szClientName
| ) |  |

Logon to a server.

Once connected to a server call this function to logon. If the login is successful CLIENTEVENT_CMD_MYSELF_LOGGEDIN is posted, otherwise CLIENTEVENT_CMD_ERROR. Once logged on it's not possible to talk to other users until the client instance joins a channel. Call TT_DoJoinChannel to join a channel.

Possible errors:

- CMDERR_INCORRECT_CHANNEL_PASSWORD
- CMDERR_INVALID_ACCOUNT
- CMDERR_MAX_SERVER_USERS_EXCEEDED
- CMDERR_SERVER_BANNED
- CMDERR_ALREADY_LOGGEDIN

Requires TeamTalk version 5.1.3.4506.

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  szNickname | The nickname to use.
  szUsername | The username of the UserAccount set up on the server.
  szPassword | The password of the user account on the server. Leave blank if no account is needed on the server.
  szClientName | The name of the client application used. This is an optional value and can be kept blank.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  ServerProperties
  TT_DoJoinChannel
  CLIENTEVENT_CMD_MYSELF_LOGGEDIN
  CLIENTEVENT_CMD_ERROR

## ◆ TT_DoLogout()

TEAMTALKDLL_API INT32 TT_DoLogout | ( | IN TTInstance * | lpTTInstance | ) |

Logout of the server.

If successful the event CLIENTEVENT_CMD_MYSELF_LOGGEDOUT will be posted.

Possible errors:

- CMDERR_NOT_LOGGEDIN

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  CLIENTEVENT_CMD_MYSELF_LOGGEDOUT

## ◆ TT_DoJoinChannel()

TEAMTALKDLL_API INT32 TT_DoJoinChannel | ( | IN TTInstance * | lpTTInstance,
|  | IN const Channel * | lpChannel
| ) |  |

Create a new channel and join it.

This function can also be used to join an existing channel and in this case the parameters szTopic and szOpPassword are ignored.

When TT_DoJoinChannel is used to create channels it works similar to IRC. If the client instance tries to join a channel which does not exist it will be created as a new channel. If the client instance is the last user to leave a channel the channel will be removed on the server.

If the channel is created successfully the event CLIENTEVENT_CMD_CHANNEL_NEW will be sent, followed by CLIENTEVENT_CMD_USER_JOINED.

User rights required:

- USERRIGHT_CREATE_TEMPORARY_CHANNEL

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_INCORRECT_CHANNEL_PASSWORD
- CMDERR_MAX_CHANNEL_USERS_EXCEEDED
- CMDERR_ALREADY_IN_CHANNEL
- CMDERR_AUDIOCODEC_BITRATE_LIMIT_EXCEEDED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  lpChannel | The channel to join or create if it doesn't already exist.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoLeaveChannel
  TT_DoMakeChannel
  CLIENTEVENT_CMD_CHANNEL_NEW
  CLIENTEVENT_CMD_MYSELF_JOINED

## ◆ TT_DoJoinChannelByID()

TEAMTALKDLL_API INT32 TT_DoJoinChannelByID | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nChannelID,
|  | IN const TTCHAR * | szPassword
| ) |  |

Join an existing channel.

This command basically calls TT_DoJoinChannel but omits the unnecessary parameters for only joining a channel and not creating a new one.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_INCORRECT_CHANNEL_PASSWORD
- CMDERR_MAX_CHANNEL_USERS_EXCEEDED
- CMDERR_ALREADY_IN_CHANNEL

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nChannelID | The ID of the channel to join.
  szPassword | The password for the channel to join.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoLeaveChannel
  TT_DoMakeChannel
  CLIENTEVENT_CMD_CHANNEL_NEW
  CLIENTEVENT_CMD_MYSELF_JOINED

## ◆ TT_DoLeaveChannel()

TEAMTALKDLL_API INT32 TT_DoLeaveChannel | ( | IN TTInstance * | lpTTInstance | ) |

Leave the current channel.

Note that TT_DoLeaveChannel() doesn't take any parameters since a user can only participate in one channel at the time. If command is successful the event CLIENTEVENT_CMD_USER_LEFT will be posted.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_NOT_IN_CHANNEL
- CMDERR_CHANNEL_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoJoinChannel
  CLIENTEVENT_CMD_MYSELF_LEFT

## ◆ TT_DoChangeNickname()

TEAMTALKDLL_API INT32 TT_DoChangeNickname | ( | IN TTInstance * | lpTTInstance,
|  | IN const TTCHAR * | szNewNick
| ) |  |

Change the client instance's nick name.

The event CLIENTEVENT_CMD_USER_UPDATE will be posted if the update was successful.

Command will be rejected if USERRIGHT_LOCKED_NICKNAME is set.

Possible errors:

- CMDERR_NOT_LOGGEDIN

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  szNewNick | is the new nick name to use.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  CLIENTEVENT_CMD_USER_UPDATE

## ◆ TT_DoChangeStatus()

TEAMTALKDLL_API INT32 TT_DoChangeStatus | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nStatusMode,
|  | IN const TTCHAR * | szStatusMessage
| ) |  |

Change the client instance's currect status.

The event CLIENTEVENT_CMD_USER_UPDATE will be posted if the update was successful.

Command will be rejected if USERRIGHT_LOCKED_STATUS is set.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nStatusMode | The value for the status mode.
  szStatusMessage | The user's message associated with the status mode.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  CLIENTEVENT_CMD_USER_UPDATE

## ◆ TT_DoTextMessage()

TEAMTALKDLL_API INT32 TT_DoTextMessage | ( | IN TTInstance * | lpTTInstance,
|  | IN const TextMessage * | lpTextMessage
| ) |  |

Send a text message to either a user or a channel.

Can also be a broadcast message which is received by all users on the server. This, however, requires USERRIGHT_TEXTMESSAGE_BROADCAST.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  lpTextMessage | A preallocated text-message struct.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  USERRIGHT_TEXTMESSAGE_BROADCAST

## ◆ TT_DoChannelOp()

TEAMTALKDLL_API INT32 TT_DoChannelOp | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN INT32 | nChannelID,
|  | IN TTBOOL | bMakeOperator
| ) |  |

Make another user operator of a channel.

User rights required:

- USERRIGHT_OPERATOR_ENABLE

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | The user who should become channel operator.
  nChannelID | The channel where the user should become operator.
  bMakeOperator | Whether user should be op'ed or deop'ed.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoChannelOpEx

## ◆ TT_DoChannelOpEx()

TEAMTALKDLL_API INT32 TT_DoChannelOpEx | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN INT32 | nChannelID,
|  | IN const TTCHAR * | szOpPassword,
|  | IN TTBOOL | bMakeOperator
| ) |  |

Make another user operator of a channel using the szOpPassword of Channel.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_USER_NOT_FOUND
- CMDERR_INCORRECT_OP_PASSWORD

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | The user who should become channel operator.
  nChannelID | The channel where the user should become operator.
  szOpPassword | The szOpPassword of Channel.
  bMakeOperator | Whether user should be op'ed or deop'ed.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoChannelOp

## ◆ TT_DoKickUser()

TEAMTALKDLL_API INT32 TT_DoKickUser | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN INT32 | nChannelID
| ) |  |

Kick user from either channel or server.

To ban a user call TT_DoBanUser before TT_DoKickUser.

User rights required:

- USERRIGHT_KICK_USERS
- Alternative channel-operator (see TT_DoChannelOp()).

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | The ID of the user to kick.
  nChannelID | The channel where the user shoul be kicked from or specify 0 to kick the user off the server.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoBanUser

## ◆ TT_DoSendFile()

TEAMTALKDLL_API INT32 TT_DoSendFile | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nChannelID,
|  | IN const TTCHAR * | szLocalFilePath
| ) |  |

Send a file to the specified channel.

If user is logged on as an admin the file can be located in any channel. If the user is not an admin the file must be located in the same channel as the user is currently participating in. The file being uploaded must have a file size which is less than the disk quota of the channel, minus the sum of all the files in the channel. The disk quota of a channel can be obtained in the `nDiskQuota` of the Channel struct passed to TT_GetChannel.

User rights required:

- USERRIGHT_UPLOAD_FILES

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_MAX_DISKUSAGE_EXCEEDED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_FILETRANSFER_NOT_FOUND
- CMDERR_OPENFILE_FAILED
- CMDERR_FILE_NOT_FOUND
- CMDERR_FILE_ALREADY_EXISTS
- CMDERR_FILESHARING_DISABLED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nChannelID | The ID of the channel of where to put the file. Only admins can upload in channel other then their own.
  szLocalFilePath | The path of the file to upload, e.g. C:\myfile.txt.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  Channel
  TT_GetChannel

## ◆ TT_DoRecvFile()

TEAMTALKDLL_API INT32 TT_DoRecvFile | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nChannelID,
|  | IN INT32 | nFileID,
|  | IN const TTCHAR * | szLocalFilePath
| ) |  |

Download a file from the specified channel.

If user is logged on as an admin the file can be located in any channel. If the user is not an admin the file must be located in the same channel as the user is currently participating in.

User rights required:

- USERRIGHT_DOWNLOAD_FILES

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_FILETRANSFER_NOT_FOUND
- CMDERR_OPENFILE_FAILED
- CMDERR_FILE_NOT_FOUND
- CMDERR_FILESHARING_DISABLED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nChannelID | The ID of the channel of where to get the file. Only admins can download in channel other then their own.
  nFileID | The ID of the file which is passed by CLIENTEVENT_CMD_FILE_NEW.
  szLocalFilePath | The path of where to store the file, e.g. C:\myfile.txt.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  CLIENTEVENT_CMD_FILE_NEW
  TT_GetChannelFiles

## ◆ TT_DoDeleteFile()

TEAMTALKDLL_API INT32 TT_DoDeleteFile | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nChannelID,
|  | IN INT32 | nFileID
| ) |  |

Delete a file from a channel.

A user is allowed to delete a file from a channel if either the user is an admin, operator of the channel or owner of the file. To be owner of the file a user must have a UserAccount on the server.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_FILE_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nChannelID | The ID of the channel where the file is located.
  nFileID | The ID of the file to delete. The ID of the file which is passed by CLIENTEVENT_CMD_FILE_NEW.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  CLIENTEVENT_CMD_FILE_NEW
  TT_GetChannelFiles

## ◆ TT_DoSubscribe()

TEAMTALKDLL_API INT32 TT_DoSubscribe | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN Subscriptions | uSubscriptions
| ) |  |

Subscribe to user events and/or data.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | The ID of the user this should affect.
  uSubscriptions | Union of Subscription to subscribe to.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  Subscription

## ◆ TT_DoUnsubscribe()

TEAMTALKDLL_API INT32 TT_DoUnsubscribe | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN Subscriptions | uSubscriptions
| ) |  |

Unsubscribe to user events/data. This can be used to ignore messages or voice data from a specific user.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | The ID of the user this should affect.
  uSubscriptions | Union of Subscription to unsubscribe.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  Subscription

## ◆ TT_DoMakeChannel()

TEAMTALKDLL_API INT32 TT_DoMakeChannel | ( | IN TTInstance * | lpTTInstance,
|  | IN const Channel * | lpChannel
| ) |  |

Make a new channel on the server.

This command only applies to users with USERRIGHT_MODIFY_CHANNELS.

User rights required:

- USERRIGHT_MODIFY_CHANNELS

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_ALREADY_EXISTS
- CMDERR_CHANNEL_NOT_FOUND If channel's combined path is longer than TT_STRLEN.
- CMDERR_INCORRECT_CHANNEL_PASSWORD If the password is longer than TT_STRLEN.
- CMDERR_UNKNOWN_AUDIOCODEC If the server doesn't support the audio codec. Introduced in version 4.1.0.1264.

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  lpChannel | A Channel-structure containing information about the channel being created. The Channel's member nChannelID is ignored.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoJoinChannel

## ◆ TT_DoUpdateChannel()

TEAMTALKDLL_API INT32 TT_DoUpdateChannel | ( | IN TTInstance * | lpTTInstance,
|  | IN const Channel * | lpChannel
| ) |  |

Update a channel's properties.

Users with USERRIGHT_MODIFY_CHANNELS can update all properties of a channel.

A user with channel-operator status (see TT_DoChannelOp()) can also update a channel's properties, but is not able to change the following properties:

- `audiocodec`
- `nDiskQuota`
- `nMaxUsers`
- `uChannelType`
  - Cannot modify CHANNEL_PERMANENT

Note that a channel's AudioCodec cannot be changed if there's currently users in the channel.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_CHANNEL_HAS_USERS
- CMDERR_CHANNEL_ALREADY_EXISTS

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  lpChannel | A Channel-structure containing information about the channel being modified. The channel member's `nParentID` and `szName` are ignored.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoMakeChannel

## ◆ TT_DoRemoveChannel()

TEAMTALKDLL_API INT32 TT_DoRemoveChannel | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nChannelID
| ) |  |

Remove a channel from a server.

This command only applies to users with USERRIGHT_MODIFY_CHANNELS.

If there's any users in the channel they will be kicked and subchannels will be deleted as well.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nChannelID | The ID of the channel to remove.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoMakeChannel

## ◆ TT_DoMoveUser()

TEAMTALKDLL_API INT32 TT_DoMoveUser | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN INT32 | nChannelID
| ) |  |

Issue command to move a user from one channel to another.

User rights required:

- USERRIGHT_MOVE_USERS

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_CHANNEL_NOT_FOUND
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | User to be moved.
  nChannelID | Channel where user should be put into.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoMoveUserByID

## ◆ TT_DoUpdateServer()

TEAMTALKDLL_API INT32 TT_DoUpdateServer | ( | IN TTInstance * | lpTTInstance,
|  | IN const ServerProperties * | lpServerProperties
| ) |  |

Update server properties.

User rights required:

- USERRIGHT_UPDATE_SERVERPROPERTIES

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  lpServerProperties | A structure holding the information to be set on the server.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_GetServerProperties

## ◆ TT_DoListUserAccounts()

TEAMTALKDLL_API INT32 TT_DoListUserAccounts | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nIndex,
|  | IN INT32 | nCount
| ) |  |

Issue command to list user accounts on the server.

The event CLIENTEVENT_CMD_USERACCOUNT will be posted for every UserAccount on the server. Ensure not to list too many many user accounts since this may suspend event handling.

User accounts can be used to create users with different user rights.

Only USERTYPE_ADMIN can issue this command.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nIndex | Index of first user to display.
  nCount | The number of users to retrieve.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  UserAccount
  UserType

## ◆ TT_DoNewUserAccount()

TEAMTALKDLL_API INT32 TT_DoNewUserAccount | ( | IN TTInstance * | lpTTInstance,
|  | IN const UserAccount * | lpUserAccount
| ) |  |

Issue command to create a new user account on the server.

Check out section User Administration to see how the server handles users.

Only USERTYPE_ADMIN can issue this command.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_INVALID_USERNAME

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  lpUserAccount | The properties of the user account to create.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoListUserAccounts
  TT_DoDeleteUserAccount
  UserAccount
  UserType

## ◆ TT_DoDeleteUserAccount()

TEAMTALKDLL_API INT32 TT_DoDeleteUserAccount | ( | IN TTInstance * | lpTTInstance,
|  | IN const TTCHAR * | szUsername
| ) |  |

Issue command to delete a user account on the server.

Only USERTYPE_ADMIN can issue this command.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_ACCOUNT_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  szUsername | The username of the user account to delete.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoListUserAccounts
  TT_DoNewUserAccount
  UserAccount
  UserType

## ◆ TT_DoBanUser()

TEAMTALKDLL_API INT32 TT_DoBanUser | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN INT32 | nChannelID
| ) |  |

Issue a ban command on a user.

The ban applies to the user's IP-address. Call TT_DoKickUser to kick the user off the server.

User rights required:

- USERRIGHT_BAN_USERS

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_USER_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nUserID | The ID of the user to ban.
  nChannelID | Set to 0 to ban from logging in. Otherwise specify user's current channel.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoKickUser()
  TT_DoListBans()
  TT_DoBanIPAddress()
  TT_DoBan()
  TT_DoBanUser()
  TT_DoBanUserEx()

## ◆ TT_DoBanUserEx()

TEAMTALKDLL_API INT32 TT_DoBanUserEx | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nUserID,
|  | IN BanTypes | uBanTypes
| ) |  |

Ban the user with `nUserID` using the ban types specified.

If `uBanTypes` contains BANTYPE_USERNAME then the username cannot join the channel where
nUserID is currently present.

If `uBanTypes` contains BANTYPE_IPADDR then the IP-address cannot join the channel where
nUserID is currently present.

See also
  TT_DoListBans()
  TT_DoBan()

## ◆ TT_DoBan()

TEAMTALKDLL_API INT32 TT_DoBan | ( | IN TTInstance * | lpTTInstance,
|  | IN const BannedUser * | lpBannedUser
| ) |  |

Ban the properties specified in `lpBannedUser`.

The `uBanTypes` specifies what the ban applies to. If BANTYPE_CHANNEL is specified in the `uBanTypes` of `lpBannedUser` then the ban applies to joining a channel, TT_DoJoinChannel(). Otherwise the ban applies to login, TT_DoLogin().

If BANTYPE_IPADDR is specified then the IP-address must be set in `szIPAddress` and any IP-address matching will receive CMDERR_SERVER_BANNED or CMDERR_CHANNEL_BANNED for TT_DoLogin() or TT_DoJoinChannel(). If instead BANTYPE_USERNAME is specified then `szUsername` must be set and the same rule applies as for IP-addresses.

See also
  TT_DoListBans()
  TT_DoBanUserEx()

## ◆ TT_DoBanIPAddress()

TEAMTALKDLL_API INT32 TT_DoBanIPAddress | ( | IN TTInstance * | lpTTInstance,
|  | IN const TTCHAR * | szIPAddress,
|  | IN INT32 | nChannelID
| ) |  |

Issue a ban command on an IP-address user.

Same as TT_DoBanUser() except this command applies to IP-addresses and therefore doesn't require a user to be logged in.

User rights required:

- USERRIGHT_BAN_USERS

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  szIPAddress | The IP-address to ban.
  nChannelID | Set to zero.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoKickUser
  TT_DoListBans

## ◆ TT_DoUnBanUser()

TEAMTALKDLL_API INT32 TT_DoUnBanUser | ( | IN TTInstance * | lpTTInstance,
|  | IN const TTCHAR * | szIPAddress,
|  | IN INT32 | nChannelID
| ) |  |

Unban the user with the specified IP-address.

User rights required:

- USERRIGHT_BAN_USERS

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_BAN_NOT_FOUND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  szIPAddress | The IP-address to unban.
  nChannelID | Set to zero.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoUnBanUserEx()
  TT_DoBanUser
  TT_DoListBans
  TT_DoBanIPAddress

## ◆ TT_DoUnBanUserEx()

TEAMTALKDLL_API INT32 TT_DoUnBanUserEx | ( | IN TTInstance * | lpTTInstance,
|  | IN const BannedUser * | lpBannedUser
| ) |  |

Unban the properties specified in BannedUser.

The uBanTypes in BannedUser determines which properties should have their ban remove. E.g. uBanTypes = BANTYPE_USERNAME and `szUsername` = "guest" will remove all bans where the username is "guest".

See also
  TT_DoBan()

## ◆ TT_DoListBans()

TEAMTALKDLL_API INT32 TT_DoListBans | ( | IN TTInstance * | lpTTInstance,
|  | IN INT32 | nChannelID,
|  | IN INT32 | nIndex,
|  | IN INT32 | nCount
| ) |  |

Issue a command to list the banned users.

The event CLIENTEVENT_CMD_BANNEDUSER will be posted for every BannedUser on the server.

User rights required:

- USERRIGHT_BAN_USERS

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.
  nChannelID | Set to zero.
  nIndex | Index of first ban to display.
  nCount | The number of bans to display.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoBanUser()

## ◆ TT_DoSaveConfig()

TEAMTALKDLL_API INT32 TT_DoSaveConfig | ( | IN TTInstance * | lpTTInstance | ) |

Save the server's current state to its settings file (typically the server's .xml file).

Only USERTYPE_ADMIN can issue this command.

Note that the server only saves channels with the flag CHANNEL_PERMANENT.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

See also
  TT_DoUpdateServer

## ◆ TT_DoQueryServerStats()

TEAMTALKDLL_API INT32 TT_DoQueryServerStats | ( | IN TTInstance * | lpTTInstance | ) |

Get the server's current statistics.

Event CLIENTEVENT_CMD_SERVERSTATISTICS will be posted when server has sent response.

Only USERTYPE_ADMIN can issue this command.

Possible errors:

- CMDERR_NOT_LOGGEDIN
- CMDERR_NOT_AUTHORIZED
- CMDERR_UNKNOWN_COMMAND

Parameters

  lpTTInstance | Pointer to client instance created by TT_InitTeamTalk.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.

## ◆ TT_DoQuit()

TEAMTALKDLL_API INT32 TT_DoQuit | ( | IN TTInstance * | lpTTInstance | ) |

Quit from server.

Possible errors:

- none

This will generate a CLIENTEVENT_CON_LOST since the server will drop the client.

Returns
  Returns command ID which will be passed in CLIENTEVENT_CMD_PROCESSING event when the server is processing the command. -1 is returned in case of error.