How to config STUN and TURN servers for Video/audio chat plugin

The Audio/Video chat feature requires Turn and Stun server to run. This article will tell you how to get the info to enter into the “STUN/TURN Server”  field in the setting page of chat plugin to enable Turn and Turn server

configure turn server

1.  Standard iceServers ( your own turn/tun server )

{
‘iceServers': [{
‘urls': ‘turn:114.72.208.156:3478‘,
‘username': ‘moo’,
‘credential': ‘xxxxxxxxxxx’
}, {
‘urls': ‘turn:114.72.208.156:3478‘,
‘username': ‘moo’,
‘credential': ‘xxxxxxxxxxx’
}]
}

Enter the above info into  “STUN/TURN Server”  field in the setting page of chat plugin to enable turn server

2. Using Turn server from twilio

1) How to get Sid and token?

Step 1: Go to https://www.twilio.com and register an account

Step 2: After create an account, log in and go to this page https://www.twilio.com/console

Step 3: Focus on “Templates” tab, find “Web Chat” and click to create a new project

Step 4: Provide project name and click “Continue”

Step 5: Click “Skip this step”

Step 6: Go to https://www.twilio.com/console/project/settings, click on “Authenticate to make changes”, then enter your account password

Step 7: Focus on “API Credentials” section, you can find “Account SID” and “Auth token” from “LIVE Credentials”. Copy and replace sid, and token with appropriate values of string below

2) Setting string format

{
‘api':{
‘url': ‘https://api.twilio.com/2010-04-01/Accounts/[SID]/Tokens.json‘,
‘sid': ‘[SID]’,
‘token': ‘[token]’
}
}

Enter the above info into  “STUN/TURN Server”  field in the setting page of chat plugin to enable turn server

3. Using turn server from xirsys provider 

1) How to get Sid and token?

Step 1: Go to https://xirsys.com/ and register an account

Step 2: After create an account, log in and go to this page https://global.xirsys.net/dashboard/services

Step 3: Click on “Services” tab, then provide your app name

Step 7: After create an app, you can see a new layout where you can find “API Token”. Copy and replace app name, username and api token with appropriate values of string below

2) Setting string format

{
‘api':{
‘url': ‘https://global.xirsys.net/_turn/[App Name]’,
‘sid': ‘[login username]’,
‘token': ‘[api token]’
}
}

Enter the above info into  “STUN/TURN Server”  field in the setting page of chat plugin to enable turn server

Please contact us if you have any questions.

Last Updated On March 06, 2019