Skip to end of metadata
Go to start of metadata

After the WRTC JS object is created and mapped with the WRTC events you have to initialize WRTC SDK JS object. While Initializing the client SDK, the client SDK specific data are obtained either from Server or Custom web application.  If the WRTC SDK Config  data type is set to client, user can get required client SDK data from web application else the required SDK config data are fetched from WRTC server.

The SDK is initialized by passing other parameters as shown below:

sonus.init(); //Initializes the client SDK
var jsonConfig = {
		"ConfigType": conf_type,
                "WrtcServerIp": server_ip,
                "stunUrl": stun_url,
                "turnUrl": turn_url,
                "turnUserName": turn_user,
                "turnCredential": turn_pwd,
                "ttl": 864000,
                "AckInterval": 30000,
                "DtmfType": "INFO",
                "WebSocketPort": 9080,
                "RestPort": isWebSocketSecure ? 443 : 8088,
                "OauthPort": isWebSocketSecure ? 443 : 8088,
                "SipUsername": sip_Username,
                "SipPassword": sip_Password,
                "StatisticsServerURL": stats_server
             }

sonus.setConfig(jsonConfig);
sonus.updateConfig("RTCPMux",value);
sonus.api.login();

where,

turnUrl and stunUrl is the TURN and STUN server URL,

turnCredential TURN server credential,

turnUserName is the TURN server username

RTCPMux is a boolean variable. The value true - rtcpMuxPolicy is set to "require" in RTCPeerConnection object, false - rtcpMuxPolicy is set to "negotiate" in RTCPeerConnection object.

Statistics Server URL is statistics server url to view the media-related statistics

sonus is the WRTC client object created.

The following code snippet shows a sample JSONconfiguration information for server:

var jsonConfig = {
		"ConfigType":"server",
		"WrtcServerIp":"15.126.198.193"
		}

It is expected that you configure the STUN and TURN servers. If you are not configuring the servers it will be assigned with its default values - 63.145.56.45:3478 for STUN server and 63.145.56.45:5000 for TURN server.

  • No labels