How to suppress permisson request to microphone in browsers?

marcw

Member
Hello!
Since I do not need access to a microphone (also not to a camera) I would like to suppress the standard browser request to allow access to the microphone. For WCS4 Alex had a certain setting in the client JS code which worked in Chrome and in Edge but not in Firefox.
May be that is possible now even for Firefox? And how to enable the suppression for Chrome and Edge?

Best regards
Marc
 

Max

Administrator
Staff member
Hello

We will check it.
It may not work out of the box in the current Web SDK 2.0 version.
Registered internal case WCS-1303. We will inform you once we have any progress.
 

marcw

Member
Thank you, Max, that sounds good.
I know that surrpressing the access requests is not so important for most of the WCS users (I think) but for me it is essential. So may be you can give me a time estimation when you know more?

Best regards
Marc
 

Max

Administrator
Staff member
Hello
We have added ability to disable microphone request.
Please check latest Web SDK build
https://flashphoner.com/downloads/b...1b0d5afee11425231d5a3d348508b8de710908.tar.gz
On JavaScript
1. Here we create a constraint which does not request microphone.
Code:
var constraints ={
audio:false,
video:false
};
Example of JavaScript where you would need to add changes:
https://demo.flashphoner.com/client2/examples/demo/sip/phone/phone.js
Code:
var outCall = session.createCall({
callee: $("#callee").val(),
visibleName: $("#sipLogin").val(),
localVideoDisplay: localDisplay,
remoteVideoDisplay: remoteDisplay,
constraints: constraints,
receiveAudio: true,
receiveVideo: false,
constraints: constraints
});
2.
session.createCall({constraints: constraints, ...});
On Server
flashphoner.properties
Code:
rtp_activity_detecting =false
Here we disable RTP activity timer because it will be triggered if no audio from browser.
 

Max

Administrator
Staff member
Please note. This update is under verification. We will report once it is completely verified.
 

marcw

Member
Max, I can confirm a very good result! I could now successfully make test calls via Chrome and Microsoft Edge without any happening microphone access requests! That is great! Only Firefox was not ready to process the streams. (no audio output)
Anyway, that is much better than what my current WCS4 server/client is able to support. (here in Germany there are still a lot of people using the MS default browser, about 20%).
Do you think that you are able to make even Firefox accepting the WCS audio stream without a permission request?

Best regards
Marc

my test environment:
Windows 10 Pro (64bit)
Chrome Version 67.0.3396.87
Microsoft Edge 42.17134.1.0
Firefox 60.0.2
 

Max

Administrator
Staff member
Hello

We are checking Firefox.
It indeed has some troubles in offer/answer exchange without microphone.
We will report as soon as we have results.

As an option you can try new WCS 5.1 version
Your case can be implemented without a conference-bridge.
1. Making a SIP call and mapping the call to a stream
https://docs.flashphoner.com/x/RIIu
2. Playing back the stream
https://docs.flashphoner.com/display/WCS5EN/In+a+browser+via+WebRTC
3. Redirecting a wav file to the SIP call.
https://docs.flashphoner.com/x/hoYu
So these three functions do not use microphone out of the box.
1 possible issue is your SIP provider can shutdown SIP session if no media sent (because conference-bridge sends comfort noise at least).
Perhaps it can be resolved using flashphoner.properties setting:
Code:
generate_av_for_ua=all
https://docs.flashphoner.com/display/WCS5EN/Settings+file+flashphoner.properties
The setting allows to generate empty audio traffic during the SIP call.
 

marcw

Member
Thank you, Max, I will try out 5.1. Can I simply uninstall 5.0, install 5.1 and enter again my serial from 5.0?

Best
Marc
 

Max

Administrator
Staff member
There is a safe way to switch between 5.0 and 5.1 without uninstall.

1. Stop server.
Code:
service webcallserver stop
2. Remove the symlink.
Code:
rm -f /usr/local/FlashphonerWebCallServer
3. Install 5.1 and activate the same license key.

You can restore 5.0 any time restoring the symlink
Code:
service webcallserver stop
rm -f /usr/local/FlashphonerWebCallServer
ln -sf /usr/local/FlashphonerWebCallServer-5.0.xxxx /usr/local/FlashphonerWebCallServer
If the command 'service webcallserver stop' does not work for any reason, try
Code:
cd /usr/local/FlashphonerWebCallServer/bin
./webcallserver stop
 
Last edited:

marcw

Member
Hi Max!
I have et up 5.1 now and made some tests with the REST API requests via that certain Chrome addon. I tried to make a phone call to my mobile and then inject a sound. The call is successful (and not stopped by my SIP provider) but the injected sound is not plyed, or at least not hearable on the phone. Do you see any errors in my sent data?

Code:
http://www.locophono.com:9091/rest-api/call/startup

{
   "callId":"3",
   "callee":"00491777000001",
   "rtmpUrl":"rtmp://localhost.com:1935/live",
   "rtmpStream":"stream3",
   "hasAudio":"true",
   "hasVideo":"false",
   "sipLogin":"xxx",
   "sipAuthenticationName":"xxx",
   "sipPassword":"xxxxxxx",
   "sipDomain":"195.201.166.182",
   "sipOutboundProxy":"195.201.166.182",
   "sipPort":"5060",
   "appKey":"defaultApp",
   "sipRegisterRequired":"true",
   "toStream": "call_stream3"
}


http://www.locophono.com:9091/rest-api/push/startup

{
   "streamName": "call_stream3",
   "rtmpUrl":"rtmp://localhost.com:1935/live",
   "options": {"action": "sound_on", "soundFile": "facebook_25.wav", "loop": false}
}


http://www.locophono.com:9091/rest-api/call/inject_stream

{
   "callId":"3",
   "streamName": "call_stream3"
}
I changed the final rest api call from /rest-api/call/inject to /rest-api/call/inject_stream . Seems there is a little bug on the doc website https://docs.flashphoner.com/pages/viewpage.action?pageId=3049094 (it's correct in the description but wrong on the last screenshot; probably from an older WCS version; who in the world is not using 5.1??? :);) )

Best
Marc
 

Max

Administrator
Staff member
Yes the doc seems incorrect. We will fix that.
Code:
/rest-api/call/inject_sound
{
"callId":"12345",
"fileName":"voice.wav"
}
The wav file should be placed in WCS_HOME/media
 

marcw

Member
Hmmm, do you mean this way:
Code:
http://www.locophono.com:9091/rest-api/call/startup

{
   "callId":"3",
   "callee":"00491777000001",
   "rtmpUrl":"rtmp://localhost.com:1935/live",
   "rtmpStream":"stream3",
   "hasAudio":"true",
   "hasVideo":"false",
   "sipLogin":"xxx",
   "sipAuthenticationName":"xxx",
   "sipPassword":"xxx",
   "sipDomain":"195.201.166.182",
   "sipOutboundProxy":"195.201.166.182",
   "sipPort":"5060",
   "appKey":"defaultApp",
   "sipRegisterRequired":"true",
   "toStream": "call_stream3"
}


http://www.locophono.com:9091/rest-api/push/startup

{
   "streamName": "call_stream3",
   "rtmpUrl":"rtmp://localhost.com:1935/live"
}



http://www.locophono.com:9091/rest-api/call/inject_sound

{
"callId":"3",
"fileName":"facebook_25.wav"
}
I removed the "option" values here for the second command. Or completely ignore the second command? I think then something is missing to merge the rtmp stream and the sip together. Anyway, it works neither in the one nor in the other way. No error messages (200 OK) but nothing to hear at the phone.

Best
Marc
 

Max

Administrator
Staff member

marcw

Member
Hi Max!
That is great! But to be honest: Meanwhile I would prefer to stay with WCS5.1 :) Probably it will make the handling easier for me. The FF tweak needs the "old" solution with adding .call files into the conference folder. Okay, I think the difference will not be sooo big. Just would like to know if it makes sense for me to wait if you can find the reason in my log file why I cannot hear anything at the called phone or if I should go on with the old solution. If so, must I go back to 5.0 or can I stay with 5.1?
P.S. As far as I understood the pcap log file no audio stream was captured. Only some noise on the other line (for the callee) was captured. I didn't say anything but one can hear the background noise.

Best regards
Marc
 

Max

Administrator
Staff member
We have reproduced the issue with /inject_sound function. Trying to fix that.
Both implementations are available in 5.1
1. Simple SIP call + Microphone suppression + Asterisk conf bridge
2. REST SIP call + inject_sound function for direct wav injection
You can also try inject_sound function with version 5.0
Here you can see how to switch from 5.0 to 5.1 and back
 
Top