TeamTalk 5 C-API DLL  Version 5.11A
TeamTalk Server API

Instantiate and run a TeamTalk server. More...

Functions

TEAMTALKDLL_API TTBOOL TTS_SetEncryptionContext (IN TTSInstance *lpTTSInstance, IN const TTCHAR *szCertificateFile, IN const TTCHAR *szPrivateKeyFile)
 Set certificate and private key for encrypted server. More...
 
TEAMTALKDLL_API TTBOOL TTS_SetEncryptionContextEx (IN TTSInstance *lpTTSInstance, const EncryptionContext *lpEncryptionContext)
 Set up encryption context for encrypted server. More...
 
TEAMTALKDLL_API TTSInstanceTTS_InitTeamTalk ()
 Create new TeamTalk server instance. More...
 
TEAMTALKDLL_API TTBOOL TTS_CloseTeamTalk (IN TTSInstance *lpTTSInstance)
 Close TeamTalk server instance. More...
 
TEAMTALKDLL_API TTBOOL TTS_RunEventLoop (IN TTSInstance *lpTTSInstance, IN INT32 *pnWaitMs)
 Run the server's event loop. More...
 
TEAMTALKDLL_API INT32 TTS_SetChannelFilesRoot (IN TTSInstance *lpTTSInstance, IN const TTCHAR *szFilesRoot, IN INT64 nMaxDiskUsage, IN INT64 nDefaultChannelQuota)
 The root folder of where users should upload files to. More...
 
TEAMTALKDLL_API INT32 TTS_UpdateServer (IN TTSInstance *lpTTSInstance, IN const ServerProperties *lpServerProperties)
 Set server properties. More...
 
TEAMTALKDLL_API INT32 TTS_MakeChannel (IN TTSInstance *lpTTSInstance, IN const Channel *lpChannel)
 Make new channel. More...
 
TEAMTALKDLL_API INT32 TTS_UpdateChannel (IN TTSInstance *lpTTSInstance, IN const Channel *lpChannel)
 Update an existing channel. More...
 
TEAMTALKDLL_API INT32 TTS_RemoveChannel (IN TTSInstance *lpTTSInstance, IN INT32 nChannelID)
 Remove a channel. More...
 
TEAMTALKDLL_API INT32 TTS_AddFileToChannel (IN TTSInstance *lpTTSInstance, IN const TTCHAR *szLocalFilePath, IN const RemoteFile *lpRemoteFile)
 Add a file to an existing channel. More...
 
TEAMTALKDLL_API INT32 TTS_RemoveFileFromChannel (IN TTSInstance *lpTTSInstance, IN const RemoteFile *lpRemoteFile)
 Remove a file from a channel. More...
 
TEAMTALKDLL_API INT32 TTS_MoveUser (IN TTSInstance *lpTTSInstance, IN INT32 nUserID, IN const Channel *lpChannel)
 Move a user from one channel to another. More...
 
TEAMTALKDLL_API INT32 TTS_SendTextMessage (IN TTSInstance *lpTTSInstance, const TextMessage *lpTextMessage)
 Send text message from server to clients. More...
 
TEAMTALKDLL_API TTBOOL TTS_StartServer (IN TTSInstance *lpTTSInstance, IN const TTCHAR *szBindIPAddr, IN UINT16 nTcpPort, IN UINT16 nUdpPort, IN TTBOOL bEncrypted)
 Start server on specified IP-address and ports. More...
 
TEAMTALKDLL_API TTBOOL TTS_StartServerSysID (IN TTSInstance *lpTTSInstance, IN const TTCHAR *szBindIPAddr, IN UINT16 nTcpPort, IN UINT16 nUdpPort, IN TTBOOL bEncrypted, IN const TTCHAR *szSystemID)
 Same as TTS_StartServer() but with the option of specifying a system-ID. More...
 
TEAMTALKDLL_API TTBOOL TTS_StopServer (IN TTSInstance *lpTTSInstance)
 Stop server and drop all users. More...
 

Detailed Description

Instantiate and run a TeamTalk server.

The Professional Edition of the TeamTalk SDK includes a header file called TeamTalkSrv.h which exposes the TeamTalk server API.

To create a TeamTalk server instance first call TTS_InitTeamTalk(). If the server should be encrypted then call TTS_SetEncryptionContext() prior to the instantiation, since the SSL context must be available before instantiation of the server.

Next configure the server instance by calling TTS_UpdateServer(). Remember to set all properties of ServerProperties. Also create a root channel by calling TTS_MakeChannel(). If there is no root channel then the server will not start. Finally call TTS_StartServer() to start the server. Now you must continuesly call TTS_RunEventLoop() to run the server event loop.

The TeamTalk server API is able to do callbacks when users perform certain events. There are two types of callbacks, one is Server Notification Callbacks and the other is Server Request Callbacks where the server is asking the server application on what to return to the user (a ClientErrorMsg is provided by the server API which will be returned to the user).

To see a simple example application of a TeamTalk server check out TeamTalk C++ Server Example (TeamTalkServer).

Function Documentation

◆ TTS_SetEncryptionContext()

TEAMTALKDLL_API TTBOOL TTS_SetEncryptionContext ( IN TTSInstance lpTTSInstance,
IN const TTCHAR szCertificateFile,
IN const TTCHAR szPrivateKeyFile 
)

Set certificate and private key for encrypted server.

The encrypted server's certificate and private key must be set prior to starting the server using TTS_StartServer().

Look in TeamTalk Server Setup Guide on how to generate the certificate and private key file using OpenSSL.

Note that this encryption option doesn't set up a certificate authority for verifying peers connecting to the server. To verify this use TTS_SetEncryptionContextEx().

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
szCertificateFilePath to server's certificate file.
szPrivateKeyFilePath to server's private key file.
See also
TTS_SetEncryptionContextEx()

◆ TTS_SetEncryptionContextEx()

TEAMTALKDLL_API TTBOOL TTS_SetEncryptionContextEx ( IN TTSInstance lpTTSInstance,
const EncryptionContext lpEncryptionContext 
)

Set up encryption context for encrypted server.

The encryption context for the server must be set prior to starting the server using TTS_StartServer().

Minimal requirements for the encryption context is to set certificate and private key.

Look in TeamTalk Server Setup Guide on how to generate the certificate and private key file using OpenSSL.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
lpEncryptionContextThe encryption context for the server, i.e. server certificate, private key and optionally certificate authority.
See also
TTS_SetEncryptionContextEx()

◆ TTS_InitTeamTalk()

TEAMTALKDLL_API TTSInstance* TTS_InitTeamTalk ( )

Create new TeamTalk server instance.

Once server instance is created call TTS_UpdateServer() to set the server's properties followed by TTS_MakeChannel() to create the root channel.

* NOTE: AT THE MOMENT CALL TTS_SetEncryptionContext() BEFORE
* CREATING THE SERVER INSTANCE, TTS_InitTeamTalk(). JUST PASS 0
* AS lpTTSInstance. IN OTHER WORDS ONLY ONE ENCRYPTION CONTEXT IS
* SUPPORTED AT THE MOMENT.
* 
See also
TTS_StartServer()

◆ TTS_CloseTeamTalk()

TEAMTALKDLL_API TTBOOL TTS_CloseTeamTalk ( IN TTSInstance lpTTSInstance)

Close TeamTalk server instance.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
See also
TTS_InitTeamTalk()
TTS_StartServer()

◆ TTS_RunEventLoop()

TEAMTALKDLL_API TTBOOL TTS_RunEventLoop ( IN TTSInstance lpTTSInstance,
IN INT32 *  pnWaitMs 
)

Run the server's event loop.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
pnWaitMsThe amount of time to wait for the event. If NULL or -1 the function will block forever or until the next event occurs.
Returns
Returns TRUE if an event has occured otherwise FALSE.
See also
TTS_InitTeamTalk()

◆ TTS_SetChannelFilesRoot()

TEAMTALKDLL_API INT32 TTS_SetChannelFilesRoot ( IN TTSInstance lpTTSInstance,
IN const TTCHAR szFilesRoot,
IN INT64  nMaxDiskUsage,
IN INT64  nDefaultChannelQuota 
)

The root folder of where users should upload files to.

The root file folder cannot be changed after the server has been started.

Ensure to set USERRIGHT_UPLOAD_FILES and USERRIGHT_DOWNLOAD_FILES in user's UserAccount.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
szFilesRootDirectory where to store uploaded files.
nMaxDiskUsageThe maximum number of bytes which can be used for file storage.
nDefaultChannelQuotaThe number of bytes available to temporary channels (not CHANNEL_PERMANENT). This will be the value in Channel nDiskQuota.
Returns
Error code from ClientError.

◆ TTS_UpdateServer()

TEAMTALKDLL_API INT32 TTS_UpdateServer ( IN TTSInstance lpTTSInstance,
IN const ServerProperties lpServerProperties 
)

Set server properties.

Set server's properties, like e.g. maximum number of users, server name, etc.

Server properties must be set prior to starting a server.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
lpServerPropertiesThe server's properties which will be see by all users who log on to the server.
Returns
Returns a ClientError.
See also
TTS_StartServer()

◆ TTS_MakeChannel()

TEAMTALKDLL_API INT32 TTS_MakeChannel ( IN TTSInstance lpTTSInstance,
IN const Channel lpChannel 
)

Make new channel.

Create a new channel on the server. Before starting a server using TTS_StartServer() the server MUST have a root channel. I.e. a Channel where nParentID is 0.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
lpChannelThe new channel to create.
Returns
Returns a ClientError.
See also
TTS_UpdateChannel()
TTS_RemoveChannel()

◆ TTS_UpdateChannel()

TEAMTALKDLL_API INT32 TTS_UpdateChannel ( IN TTSInstance lpTTSInstance,
IN const Channel lpChannel 
)

Update an existing channel.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
lpChannelThe updated channel properties. nChannelID and nParentID must remain the same.
Returns
Returns a ClientError.
See also
TTS_MakeChannel()
TTS_RemoveChannel()

◆ TTS_RemoveChannel()

TEAMTALKDLL_API INT32 TTS_RemoveChannel ( IN TTSInstance lpTTSInstance,
IN INT32  nChannelID 
)

Remove a channel.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
nChannelIDThe ID of the channel to remove.
Returns
Returns a ClientError.
See also
TTS_MakeChannel()
TTS_UpdateChannel()

◆ TTS_AddFileToChannel()

TEAMTALKDLL_API INT32 TTS_AddFileToChannel ( IN TTSInstance lpTTSInstance,
IN const TTCHAR szLocalFilePath,
IN const RemoteFile lpRemoteFile 
)

Add a file to an existing channel.

Ensure to have set up file storage first using TTS_SetChannelFilesRoot(). Also ensure Channel's nDiskQuota is specified.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
szLocalFilePathPath to file.
lpRemoteFileProperties of file to add.
Returns
Command error code from ClientError.
See also
TTS_SetChannelFilesRoot().
TTS_MakeChannel()

◆ TTS_RemoveFileFromChannel()

TEAMTALKDLL_API INT32 TTS_RemoveFileFromChannel ( IN TTSInstance lpTTSInstance,
IN const RemoteFile lpRemoteFile 
)

Remove a file from a channel.

Ensure to have set up file storage first using TTS_SetChannelFilesRoot(). Also ensure Channel's nDiskQuota is specified.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
lpRemoteFileProperties of file to remove. Channel ID and file name is enough.
Returns
Command error code from ClientError.
See also
TTS_SetChannelFilesRoot().
TTS_MakeChannel()

◆ TTS_MoveUser()

TEAMTALKDLL_API INT32 TTS_MoveUser ( IN TTSInstance lpTTSInstance,
IN INT32  nUserID,
IN const Channel lpChannel 
)

Move a user from one channel to another.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
nUserIDThe ID of the user to move.
lpChannelThe channel the user should move to. If the channel already exists then simply set nChannelID. To make a user leave a channel set nChannelID to 0.
Returns
Returns a ClientError.
See also
TT_DoMoveUser()

◆ TTS_SendTextMessage()

TEAMTALKDLL_API INT32 TTS_SendTextMessage ( IN TTSInstance lpTTSInstance,
const TextMessage lpTextMessage 
)

Send text message from server to clients.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
lpTextMessageText message to send. The message type determines how the message will be sent.
Returns
Returns a ClientError.
See also
TT_DoTextMessage()

◆ TTS_StartServer()

TEAMTALKDLL_API TTBOOL TTS_StartServer ( IN TTSInstance lpTTSInstance,
IN const TTCHAR szBindIPAddr,
IN UINT16  nTcpPort,
IN UINT16  nUdpPort,
IN TTBOOL  bEncrypted 
)

Start server on specified IP-address and ports.

Before starting a server the root channel must be created using TTS_MakeChannel().

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
szBindIPAddrThe IP-address to bind to.
nTcpPortThe TCP port to bind to.
nUdpPortThe UDP port to bind to.
bEncryptedIf encryption is enabled then encryption context must be set prior to this call using TTS_SetEncryptionContext().
See also
TTS_SetEncryptionContext()
TTS_MakeChannel()

◆ TTS_StartServerSysID()

TEAMTALKDLL_API TTBOOL TTS_StartServerSysID ( IN TTSInstance lpTTSInstance,
IN const TTCHAR szBindIPAddr,
IN UINT16  nTcpPort,
IN UINT16  nUdpPort,
IN TTBOOL  bEncrypted,
IN const TTCHAR szSystemID 
)

Same as TTS_StartServer() but with the option of specifying a system-ID.

Requires TeamTalk version 5.1.3.4506.

Parameters
lpTTSInstancePointer to the server instance created by TTS_InitTeamTalk().
szBindIPAddrThe IP-address to bind to.
nTcpPortThe TCP port to bind to.
nUdpPortThe UDP port to bind to.
bEncryptedIf encryption is enabled then encryption context must be set prior to this call using TTS_SetEncryptionContext().
szSystemIDThe identification of the conferencing system. The default value is "teamtalk". See TT_ConnectSysID().

◆ TTS_StopServer()

TEAMTALKDLL_API TTBOOL TTS_StopServer ( IN TTSInstance lpTTSInstance)

Stop server and drop all users.

See also
TTS_StartServer()