How to suppress permisson request to microphone in browsers?

marcw

Member
Okay, I think I'll wait a few more days and hope that it can be fixed. :)
But just to make it clear: You write that the inject_sound also works in 5.0. But you also said a few days ago that I must switch from 5.0 to 5.1 if I want to use the REST api. And inject_sound is part of it, or not?
 

Max

Administrator
Staff member
We recommended 5.1 because this version where we will do further bug-fixes and updates.
So you can use 5.0 and inject_sound function and it may work with 5.0. But in the case of any troubles or bugs you will have to update to 5.1 to get fixes.
 

marcw

Member
Max, do you think that I should wait for a fix of the issue with failed playback of injected wav files? I also could focus on the other sollution with manually copying .call files into the conference folder. It just depends on the estimated time needed for a fix. If your answer is "Probably fixed within the next 5 days" I would wait. In every other case I would go on with the other solution.
This was not a "push" for my request. But if you have an idea about the fixing time or if you have no idea of the fixing time, please just let me know.

Best regards
Marc
 

Max

Administrator
Staff member
Hello
Yes we believe the inject_sound function will be restored in few days.
 

marcw

Member
Thanx, Max! I have new installed build 3372 now but still cannot hear the injected wav file sound on the called phone. Phone call is working, connection established when picking up the phone but nothing can be heared.

flashphoner.properities:
Code:
ip                     =195.201.166.182
ip_local               =195.201.166.182
port_from              =30000
port_to                =31000
media_port_from        =31001
media_port_to          =32000
waiting_answer         =60
user_agent             =Flashphoner/1.0
balance_header         =balance
cost_header            =cost
video_enabled          =false
domain                 =
outbound_proxy         =
outbound_port          =
log_level              =5
enable_context_logs    =false
rtp_activity_detecting =false
sip_msg_listener       =com.flashphoner.sdk.sip.ChangeCallIdListener
call_record_listener   =com.flashphoner.server.client.DefaultCallRecordListener
dtmf                     =rfc2833
auto_login_url         =/usr/local/FlashphonerWebCallServer/conf/account.xml
get_callee_url         =/usr/local/FlashphonerWebCallServer/conf/callee.xml
codecs                   =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip       =mpeg4-generic,flv,mpv
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp  =opus,g729,g722,mpeg4-generic,vp8,mpv
on_record_hook_script  =on_record_hook.sh
rtmp_transponder_stream_name_prefix =rtmp_
rtp_force_synchronization=true
stun_freshness_timeout=1000000000
add_register_auth_headers=false
ws.port                 =8080
wss.port                =8443
wss.keystore.password   =password
wss.cert.password       =password
rtmp.port               =1935
rtmfp.port              =1935
keep_alive.algorithm       =HIGH_LEVEL
keep_alive.peer_interval   =2000
keep_alive.server_interval =5000
keep_alive.probes          =10
video_reliable          =partial
audio_reliable          =partial
audio_frames_per_packet =6
burst_avoidance_count   =100
flush_audio_interval    =80
flush_video_interval    =0
generate_av_for_ua=all
console log:
Code:
20:36:59,046 INFO  agerRemoteRmiService - RMI TCP Connection(29)-127.0.0.1 RECEIVED REST OBJECT <==
URL:http://localhost:9091/EchoApp/CallStatusEvent
OBJECT:
{
  "nodeId" : "cS4t5WgllYUCpmhTBZ4xhiNOQ23Ismo4@0.0.0.0",
  "appKey" : "defaultApp",
  "sessionId" : "127.0.0.1:2219228756171646330",
  "callId" : "7",
  "incoming" : false,
  "status" : "ESTABLISHED",
  "caller" : "mpapp2",
  "callee" : "00491777000001",
  "remoteAudioCodec" : "PCMA",
  "createDate" : 1532543807972,
  "hasAudio" : true,
  "hasVideo" : false,
  "visibleName" : "mpapp2",
  "mediaProvider" : "Flash",
  "sipStatus" : 200,
  "holdForTransfer" : false,
  "msrp" : false,
  "history" : false,
  "id" : "4_127.0.0.1:2219228756171646330"
}
20:37:13,236 INFO    RestCallController - http-nio-9091-exec-10 handleRequest /rest-api/call/inject_sound params:{callId=7, fileName=facebook5.wav}
My API commands:
Code:
http://www.locophono.com:9091/rest-api/call/startup

{
   "callId":"7",
   "callee":"00491777000001",
   "hasAudio":"true",
   "hasVideo":"false",
   "sipLogin":"mpapp2",
   "sipAuthenticationName":"mpapp2",
   "sipPassword":"xxxxxxxx",
   "sipDomain":"195.201.166.182",
   "sipOutboundProxy":"195.201.166.182",
   "sipPort":"5060",
   "appKey":"defaultApp",
   "sipRegisterRequired":"true"
}



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

{
   "callId":"7",
   "fileName": "facebook5.wav"
}
I'll send you the pcap log file via email now. :)

Best regards
Marc
 

Max

Administrator
Staff member
Hello
The same works for us on our WCS server.
Please provide SIP details and SSH access to your WCS server.
We will check the call and sound injection on your WCS server.
support@flashphoner.com
 

marcw

Member
STOP!! I tried something else now and that worked! I used the SIP data from my VOIP provider itsself and not the ones from my own Asterisk server which reconnects to my VOIP provider as usual in the past. Sorry!! That was a thinking error by myself! It seems indeed that I can go on now. Thank you very much, Max!!!

Best
Marc
 

marcw

Member
Okay, I think I am rather close to bring the pieces together. Only how to inject an audio file playback to the sip callee (works with the REST-API) AND to the user's browser is still a secret for me. If I am right I cannot test this out of the box with one of the web apps, right? Also the REST-API isn't enough because it cannot playback a received stream. Can you give me some help here, Max?

Best regards
Marc
 

Max

Administrator
Staff member
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"
}
As you noted, you set "toStream" : "call_stream3"
This means the call is mapped to regular stream which you can play from browser in a player.
https://docs.flashphoner.com/display/WCS5EN/In+a+browser+via+WebRTC

So to implement this case you have to implement three functions:
1. Make a call using REST and map the call to a stream
https://docs.flashphoner.com/pages/viewpage.action?pageId=3048004
2. Inject sound file into the call.
https://docs.flashphoner.com/pages/viewpage.action?pageId=3049094
3. Play the mapped stream in browser.
https://docs.flashphoner.com/display/WCS5EN/In+a+browser+via+WebRTC
 

Max

Administrator
Staff member
Maybe
Try to add setting
Code:
rtp_force_synchronization=true
in flashphoner.properties
Generally it helps with audio-only streams.
 

marcw

Member
It is already set to true.
May be you can have a look on my server directly if you have the time? I had sent you the login data recently.
 

Max

Administrator
Staff member
We will.
Can we call to a global mobile number to check it, i.e. to a bank IVR?
 

marcw

Member
Please keep in mind that I sent you two different sip account data. The first ones are for my Asterisk server, the second ones for my VOIP provider access. You should use the second ones. Obviously I will use them later in the final project directly and not like in the past via the Asterisk server.
 

Max

Administrator
Staff member
Hello
We have checked.
It works if set audio-only constraints in Player
Example:
Code:
session.createStream({constraints:{audio:true,video:false}).play();
You have to tweak player script:
Example:
https://demo.flashphoner.com/client2/examples/demo/streaming/player/player.html
https://demo.flashphoner.com/client2/examples/demo/streaming/player/player.js
The player.js script is located in WCS_HOME/client2/examples/demo/streaming/player/player.js
Some docs about script locations https://docs.flashphoner.com/display/WCS5EN/Web+SDK
 
Top