You can do this with the REST API:
/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/webrtc
<- Endpoint path
An example using cURL for an app called webrtc
would be
curl --digest -u user:passwd -X PUT -H 'Accept:application/json; charset=utf-8' -H 'Content-Type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/webrtc/webrtc -d'
{
"restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/webrtc",
"udpBindAddress": "",
"enablePlay": false,
"preferredCodecsAudio": "",
"preferredCodecsVideo": "",
"enableQuery": true,
"debugLog": false,
"serverName": "",
"saveFieldList": [
""
],
"iceCandidateIpAddresses": "",
"version": "",
"enablePublish": false
}'
Just toggle enableQuery to be the value you want to set, and fill in other fields to match your app if needed (and pass credentials if REST Interface requires them.
You can do a GET request first to retrieve the current WebRTC setup. They can then be used to help with populating the fields for the PUT
curl --digest -u user:passwd -X GET http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/webrtc/webrtc