WCS 5 Example Script is not working

Sajin

New Member
I am trying out "flashphoner5/client/examples/min/phone/Phone-min.html"

I am able to connect using WebRTC with this example, however I need a fallback to flash as some audio related settings are not working on insecure domains on chrome. So I have made following changes to the example configuration:

f.init({
pathToSWF:'../../../dependencies/flash/MediaManager.swf',
forceFlashForWebRTCBrowser:true,
elementIdForSWF:'MyFlashDiv'});

and
call.mediaProvider = "Flash".

Its being registered, showing FlashPermissionBox, When allow is clicked, call is getting through, but when call is attended it suddenly disconnects from the client.

This appears to be Chrome
Phone-min.js:87 Flash - INFO: UTC 9.18 10:18:3.287: mic Default
Phone-min.js:87 Flash - INFO: UTC 9.18 10:25:47.717: Configuration object: undefined Height: undefined FPS: undefined KEEP_RATIO: undefined KEY_INT: undefined QUALITY: undefined MOTION_LEVEL: undefined BANDWIDTH: undefined
Phone-min.js:87 Flash - INFO: UTC 9.18 10:25:47.729: Final configuration: WIDTH: 0 Height: 0 FPS: 15 KEEP_RATIO: true KEY_INT: 48 QUALITY: 80 MOTION_LEVEL: 2000 BANDWIDTH: 0
Phone-min.js:87 ESTABLISHED
Phone-min.js:87 Connection has been established. You can start a new call.
Phone-min.js:87 REGISTERED
Phone-min.js:87 Flash - INFO: UTC 9.18 10:25:51.998: current mic muted - false
Phone-min.js:87 Flash - INFO: UTC 9.18 10:25:52.1: mic status Microphone.Unmuted
Phone-min.js:87 notifyTryingResponse call.callId:b7ad571f-a552-42cd
Phone-min.js:87 TRYING
Phone-min.js:87 ring call.status: RING call.callId: b7ad571f-a552-42cd
Phone-min.js:87 RING
Phone-min.js:87 Flash - INFO: UTC 9.18 10:26:0.584: changeAudioCodec: pcmu
Phone-min.js:87 Flash - INFO: UTC 9.18 10:26:0.587: changeCodec: pcmu
Phone-min.js:87 Flash - INFO: UTC 9.18 10:26:0.923: PhoneSpeaker play streamName=IN_caller_b7ad571f-a552-42cd; currentStremName=null
Phone-min.js:87 Flash - INFO: UTC 9.18 10:26:0.927: PhoneSpeaker startNewIncomingStream streamName=IN_caller_b7ad571f-a552-42cd
Flashphoner.js:378 Uncaught Error: Error: An invalid exception was thrown.callbacks.talk @ Flashphoner.js:378(anonymous function)
(In Firefox, slightly different)
Error: Error calling method on NPObject!
me.mediaProviders.get(call.mediaProvider).talk(call.callId, call.hasVideo);


Its having an exception: on me.mediaProviders.get(call.mediaProvider).talk(call.callId, call.hasVideo);
I have checked the call object properties: call.callId have a value and call.hasVideo is false.

What could be the reason?
 
Last edited:

Max

Administrator
Staff member
Flash fallback is disabled in WebRTC browsers such as Chrome and Firefox.
You can see this code: line 56 of Flashphoner.js
So you can try to set
Code:
configuration.forceFlashForWebRTCBrowser=true;
This option may work but it is not recommended. We had disabled this option in past due some bugs in WebRTC browsers with Flash plugin.
Please consider secure (https) domains as a solution.
If you provide a solution for other non-secure web-sites you can try to use a secure iframe on https page.

BTW
We plan to release new web API 2.0 this month. Please see new sip/phone samples here
Sources: https://github.com/flashphoner/flashphoner_client/tree/wcs_api-2.0
 

Sajin

New Member
I have managed browser to force the browser to take flash. But the following error still occurs.

Error: Error calling method on NPObject!
me.mediaProviders.get(call.mediaProvider).talk(call.callId, call.hasVideo);

I tried in Safari too, same error is occurring, although its a javascript error, is it happening due to any firewall related issue? ( 1935 is already listening )


 

Max

Administrator
Staff member
This option is disabled by default and it is no longer supported.
Latest versions of API are designed to use WebRTC in WebRTC enabled browsers and Flash fallback in others.
I have tested our API 2.0 example in Mac OS Safari, Flash Player 23
My test:
1. Open demo example https://wcs5-eu.flashphoner.com
Demo2 / Phone
2. Install latest Flash Player 23 for your Safari browser and make sure it is installed and enabled
https://get.adobe.com/flashplayer/
3. Test it.
It works for me out of the box without the 'force' setting.
Here you can find dev docs related this example:
http://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-developer-guide-2/phone_web_sdk.htm
 

Attachments

Top