When a new Allocation is created in a TURN server, this allocation cannot process any incoming packet from other peers if has no permissions. So, in order to allow other peers to communicate using a Relayed IP Address, first the TURN Client must create permissions for the IP Addresses that are allowed to exchange Data.
To Create a new Permission, just call the method CreatePermission and pass as a parameter the IP Address of the peer. If the Peer IP already exists on the TURN server, it will be refreshed, if not, it will be created. Permissions expire after 5 minutes unless are refreshed.
The TURN client, only allows to call the method CreatePermission if exists an active allocation.
If the permission is created successfully, the event OnTURNCreatePermission is called.
oTURN.CreatePermission("80.147.23.157");
void OnTURNCreatePermission(Component Sender; TsgcSocketConnection aSocket;
TsgcSTUN_Message aMessage; TsgcTURN_ResponseCreatePermission aCreatePermission)
{
DoLog("#Create Permission: " + aCreatePermission.IPAddresses);
}