Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1b5e4b1
[ADD] FPNR-371, added tel uri support.
flashphoner Sep 27, 2013
e00c54c
[FIX] FPNR-372, message doubles at receiving side.
flashphoner Sep 27, 2013
5e0f29a
[ADD] FPNR-367, add msrp support to FLASH api.
flashphoner Sep 27, 2013
3ee4395
[FIX] FPNR-382 - WCS client fallback to RTMFP doesn't work.
flashphoner Oct 7, 2013
175aea5
Merge branch 'wsc' of github.com:flashphoner/flashphoner_client into wsc
flashphoner Oct 7, 2013
554dfc7
[ADD] Send SIP headers to WCS client upon Register.
flashphoner Oct 8, 2013
1f8ef6b
WSS Support
flashphoner Oct 9, 2013
d20765f
Merge branch 'wsc' of github.com:flashphoner/flashphoner_client into wsc
flashphoner Oct 9, 2013
4a4f5e4
[ADD] FPNR-374 - add config property to force WebRTC or flash API.
flashphoner Oct 11, 2013
7520814
Merge branch 'wsc' of github.com:flashphoner/flashphoner_client into wsc
flashphoner Oct 11, 2013
24812b8
[FIX] Fallback client support in Safari.
flashphoner Oct 15, 2013
7532b6d
[FIX] Fixed Caller-ID display information.
flashphoner Oct 16, 2013
4af2458
[FIX] Stop ringing sound.
flashphoner Oct 16, 2013
f533034
[ADD] Service messages filter.
flashphoner Oct 16, 2013
401c7a4
[ADD] Added new content type for service messages.
flashphoner Oct 17, 2013
1917136
[ADD] FPNR-396, Add client side settings msg_content_type
flashphoner Oct 17, 2013
554d40a
[FIX] Load balancer does not work.
flashphoner Oct 23, 2013
cef0e29
[ADD] FPNR-409, Add wss port to load balancer response.
flashphoner Oct 28, 2013
68964a8
[FIX] MCN processing, added unit tests
flashphoner Oct 30, 2013
3c7b5a9
[ADD] FPNR-417, add SDP filter.
flashphoner Oct 30, 2013
1f940c1
Removed <strip_codec> from default flashphoner.xml
flashphoner Oct 30, 2013
52fb520
Merge branch 'wsc' of github.com:flashphoner/flashphoner_client into wsc
flashphoner Oct 30, 2013
5e5fb28
[ADD] Added sdp filter to callByToken function.
flashphoner Oct 31, 2013
da3b875
[ADD] Added ability to change stun server address in flashphoner.xml
flashphoner Nov 4, 2013
a54699d
[ADD] MCN status notification display.
flashphoner Nov 6, 2013
1005bf7
Added registerRequired property
flashphoner Nov 8, 2013
4c7181b
Minor fix for previous commit
flashphoner Nov 8, 2013
a37a0a1
[FIX] FPNR-403, Safari, flash settings panel remains after access gra…
flashphoner Nov 11, 2013
db32499
[FIX] FPNR-432 - Bad SDP from WebRTC client
flashphoner Nov 13, 2013
0f3b95d
[ADD] Logs on close peerconnection
flashphoner Nov 25, 2013
9088126
Fixed subscribe_event setting
flashphoner Dec 2, 2013
d6b5d1b
Merge branch 'wsc' of github.com:flashphoner/flashphoner_client into wsc
flashphoner Dec 2, 2013
14a512b
Default STUN server is removed to speed up WebRTC connection
flashphoner Dec 4, 2013
7a79bee
Added debug logs
flashphoner Dec 8, 2013
0a4c1ca
Added SIP delayed offer support.
flashphoner Dec 8, 2013
b8b6c8c
Added minimal support for Phone.html(pure Flash application)
flashphoner Dec 11, 2013
f1699d2
[MERGE] db3249957093269354e77f7988c8fd6f138118b1
flashphoner Dec 12, 2013
029fba5
Do not use strip_codecs by default
flashphoner Dec 18, 2013
760924e
[ADD] FPNR-482 - Remove all local candidates from Chrome sdp to optim…
flashphoner Dec 23, 2013
530a6ba
Update README
crlshn Mar 18, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
Flashphoner-client is an open-source part of Flashphoner product.
You can use it for customization.

Builds: http://flashphoner.com/downloads/builds/flashphoner_client/
Builds: http://flashphoner.com/downloads/builds/flashphoner_client/

requirement:
DETECTING java command...
- Java command found successfully.

DETECTING JVM architecture...
- 64-Bit architecture detected successfully.

DETECTING JDK home...
- JDK home detected successfully: /usr/java/default.

DETECTING ANT...
- Error: ANT is not found
14 changes: 14 additions & 0 deletions client/api/src/com/flashphoner/api/Flash_API.as
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ package com.flashphoner.api
ExternalInterface.addCallback("notificationResult",notificationResult);
ExternalInterface.addCallback("call",call);
ExternalInterface.addCallback("callByToken",callByToken);
ExternalInterface.addCallback("msrpCall",msrpCall);
ExternalInterface.addCallback("hangup",hangup);
ExternalInterface.addCallback("answer",answer);
ExternalInterface.addCallback("subscribe",subscribe);
Expand Down Expand Up @@ -377,6 +378,10 @@ package com.flashphoner.api
if (callee.indexOf("@") == -1 || callee.indexOf("@") == callee.length-1){
return 1;
}
}else if (callee.indexOf("tel:") == 0){
if (callee.substring(4).search(reg) != -1){
return 1;
}
}else{
if (callee.search(reg) != -1){
if (callee.indexOf("@") != -1){
Expand Down Expand Up @@ -413,6 +418,15 @@ package com.flashphoner.api
phoneServerProxy.callByToken(callObject);
return 0;
}

/**
* Create new msrp call
* @param call object
**/
public function msrpCall(callObject:Object):int{
phoneServerProxy.msrpCall(callObject);
return 0;
}

/**
* Get information about logged user
Expand Down
12 changes: 12 additions & 0 deletions client/api/src/com/flashphoner/api/PhoneModel.as
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ package com.flashphoner.api
parameters[node] = String(xml[node]);
}

var wcs_server:String = xml.wcs_server;
if (wcs_server!=null && wcs_server.length!=0){
PhoneConfig.WCS_SERVER = wcs_server;
}
Logger.info("WCS_SERVER: "+PhoneConfig.WCS_SERVER);

var rtmfp_port:String = xml.rtmfp_port;
if (rtmfp_port!=null && rtmfp_port.length!=0){
PhoneConfig.RTMFP_PORT = int(rtmfp_port);
}
Logger.info("RTMFP_PORT: "+PhoneConfig.RTMFP_PORT);

var use_enhanced_mic:String = xml.use_enhanced_mic;

if (use_enhanced_mic!=null && use_enhanced_mic.length!=0){
Expand Down
9 changes: 7 additions & 2 deletions client/api/src/com/flashphoner/api/PhoneServerProxy.as
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ package com.flashphoner.api

public function callByToken(callObject:Object):void{
Logger.info("PhoneServerProxy.callByToken()");
nc.call("call",responder, callObject);
}
nc.call("call", responder, callObject);
}

public function msrpCall(callObject:Object):void{
Logger.info("PhoneServerProxy.msrpCall()");
nc.call("msrpCall", responder, callObject);
}

public function disconnect():void {
hasDisconnectAttempt = true;
Expand Down
4 changes: 4 additions & 0 deletions client/api/src/com/flashphoner/api/data/PhoneConfig.as
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ package com.flashphoner.api.data

public static var LOAD_BALANCER_URL = null;

public static var WCS_SERVER:String = "192.168.1.5";

public static var RTMFP_PORT:int = 1935;

/**
* Current version of Flashphoner product
**/
Expand Down
2 changes: 1 addition & 1 deletion client/api/src/com/flashphoner/api/js/APINotifyJS.as
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ package com.flashphoner.api.js
ExternalInterface.call("notifyConnected");
}
public function notifyRegistered(_sipObject:Object):void{
ExternalInterface.call("notifyRegistered");
ExternalInterface.call("notifyRegistered", _sipObject);
}
public function notifyBalance(balance:Number,_sipObject:Object):void{
ExternalInterface.call("notifyBalance",String(balance));
Expand Down
2 changes: 1 addition & 1 deletion client/client/src/Phone.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Flash phone</title>
<link rel="stylesheet" type="text/css" href="styles/style_html.css" />
<script type="text/javascript" src='swfobject.js'></script>
<script type="text/javascript" src='js/swf/swfobject.js'></script>
<script type="text/javascript">
var flashphoner;
function sendDtmf(dtmf){
Expand Down
8 changes: 7 additions & 1 deletion client/client/src/PhoneJS.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<script type="text/javascript" src="js/StaticData.js"></script>
<script type="text/javascript" src="js/Phone.js"></script>
<script type="text/javascript" src="js/FlashphonerLoader.js"></script>
<script type="text/javascript" src="js/UnitTests.js"></script>

<!-- ************* -->
<title>Phone</title>
Expand Down Expand Up @@ -71,7 +72,7 @@

<input class="phone_screen_1" id="calleeText" value=""/>

<div class="phone_screen_2"><div id="checkboxUseProxyDiv" style="display:none"><input id="checkboxUseProxy" type="checkbox" checked>Use WebRTC Proxy</input></div></div>
<div id="phoneScreen2" class="phone_screen_2"><div id="checkboxUseProxyDiv" style="display:none"><input id="checkboxUseProxy" type="checkbox" checked>Use WebRTC Proxy</input></div></div>

<!-- <input class="chat_button" id="chatButton" type="submit" value="Chat" /> -->
<!-- <input class="call_button" id="callButton" type="submit" value="Call" /> -->
Expand Down Expand Up @@ -216,5 +217,10 @@
</div>
<!-- ******* -->

<!-- TestButton -->
<div id="testButton" class="testButton">Test
</div>
<!-- ******* -->

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This code and accompanying materials also available under LGPL and MPL license f
import com.flashphoner.Logger;
import com.flashphoner.api.Flash_API;
import com.flashphoner.api.SoundControl;
import com.flashphoner.api.data.PhoneConfig;
import com.flashphoner.phone.DataPhone;

import flash.utils.setTimeout;
Expand Down Expand Up @@ -73,6 +74,9 @@ This code and accompanying materials also available under LGPL and MPL license f
var callObject:Object = new Object();
callObject.callee = calleeNumber;
callObject.visibleName = flashAPI.modelLocator.visibleName;
callObject.hasVideo = PhoneConfig.VIDEO_ENABLED;
callObject.inviteParameters = "name=value";
callObject.isMsrp = false;
var result:int = flashAPI.call(callObject);
if (result == 0) {
delaythisEnabled(3000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This code and accompanying materials also available under LGPL and MPL license f
import com.adobe.cairngorm.control.CairngormEventDispatcher;
import com.flashphoner.Logger;
import com.flashphoner.api.Flash_API;
import com.flashphoner.api.data.PhoneConfig;
import com.flashphoner.phone.DataPhone;

import mx.controls.Alert;
Expand Down Expand Up @@ -54,12 +55,14 @@ This code and accompanying materials also available under LGPL and MPL license f

DataPhone.getInstance().viewController.showConnectingView();
var loginObject:Object = new Object();
loginObject.username = "sip:"+username.text+"@"+domain.text;
loginObject.login = username.text;
loginObject.password = password.text;
loginObject.authenticationName = authName.text;
loginObject.outboundProxy = outboundProxy.text;
loginObject.domain = domain.text;
loginObject.port = port.text;
if (DataPhone.getInstance().flash_API.login(loginObject, "rtmfp://192.168.1.5:1935/phone_app") == 0){
loginObject.registerRequired = PhoneConfig.REGISTER_REQUIRED;
if (DataPhone.getInstance().flash_API.login(loginObject, "rtmfp://"+PhoneConfig.WCS_SERVER+":"+PhoneConfig.RTMFP_PORT+"/phone_app") == 0){
save();
}
}
Expand Down
4 changes: 3 additions & 1 deletion client/client/src/flashphoner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
This code and accompanying materials also available under LGPL and MPL license for Flashphoner buyers. Other license versions by negatiation. Write us support@flashphoner.com with any questions.
-->
<flashphoner>
<wcs_server>192.168.1.5</wcs_server>
<wcs_server>87.226.225.59</wcs_server>
<ws_port>8080</ws_port>
<wss_port>8443</wss_port>
<use_wss>false</use_wss>
<rtmfp_port>1935</rtmfp_port>
<register_required>true</register_required>
<!--<token>etgrtgrth</token>-->
Expand Down
2 changes: 1 addition & 1 deletion client/client/src/flashphoner_js_api.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This code and accompanying materials also available under LGPL and MPL license f
if (flashAPI.isInitialized()){
Logger.info("FlashAPI has been initialized");
flashAPI.initMedia();
ExternalInterface.call("notifyFlashReady");
ExternalInterface.call("notifyConfigLoaded");
} else{
Logger.info("Waiting flashAPI initialization...");
setTimeout(wait,500);
Expand Down
4 changes: 2 additions & 2 deletions client/client/src/js/Click2Call.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ function addLogMessage(message) {
trace('addLogMessage', message);
}

function notifyFlashReady() {
trace("notifyFlashReady");
function notifyConfigLoaded() {
trace("notifyConfigLoaded");
flashphoner = flashphonerLoader.getFlashphoner();
flashphoner_UI = flashphonerLoader.getFlashphonerUI();
if (flashphonerLoader.useWebRTC) {
Expand Down
92 changes: 80 additions & 12 deletions client/client/src/js/FlashphonerLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FlashphonerLoader = function (config) {
this.loadBalancerUrl = null;
this.jsonpSuccess = false;
this.token = null;
this.registerRequired = false;
this.registerRequired = true;
this.videoWidth = 320;
this.videoHeight = 240;
this.pushLogEnabled = false;
Expand All @@ -32,10 +32,12 @@ FlashphonerLoader = function (config) {
this.finishSound = "sounds/HANGUP.ogg";
this.xcapUrl = null;
this.msrpCallee = null;
this.subscribeEvent = "reg";
this.subscribeEvent = null;
this.contactParams = null;
this.imdnEnabled = false;

this.msgContentType = "text/plain";
this.stripCodecs = new Array();
this.stunServer = "";

$.ajax({
type: "GET",
Expand All @@ -61,6 +63,15 @@ FlashphonerLoader.prototype = {
if (wsPort.length > 0) {
this.wsPort = wsPort[0].textContent;
}
var wssPort = $(xml).find("wss_port");
if (wssPort.length > 0) {
this.wssPort = wssPort[0].textContent;
}
var useWss= $(xml).find("use_wss");
if (useWss.length > 0) {
this.useWss = "true" == useWss[0].textContent;
}

var flashPort = $(xml).find("flash_port");
if (flashPort.length > 0) {
this.flashPort = flashPort[0].textContent;
Expand All @@ -79,7 +90,7 @@ FlashphonerLoader.prototype = {
}
var registerRequired = $(xml).find("register_required");
if (registerRequired.length > 0) {
this.registerRequired = registerRequired[0].textContent;
this.registerRequired = (registerRequired[0].textContent === "true");
}
var videoWidth = $(xml).find("video_width");
if (videoWidth.length > 0) {
Expand Down Expand Up @@ -156,6 +167,44 @@ FlashphonerLoader.prototype = {
}
}

//Message content type by default "text/plain", can be "message/cpim"
var msgContentType = $(xml).find("msg_content_type");
if (msgContentType.length > 0) {
this.msgContentType = msgContentType.text();
console.log("Message content type: " + this.msgContentType);
}

var stripCodecs = $(xml).find("strip_codecs");
if (stripCodecs.length > 0) {
var tempCodecs = stripCodecs[0].textContent.split(",");
for (i = 0; i < tempCodecs.length; i++) {
if (tempCodecs[i].length) this.stripCodecs[i] = tempCodecs[i];
console.log("Codec " + tempCodecs[i] + " will be removed from SDP!");
}
}

//stun server address
var stunServer = $(xml).find("stun_server");
if (stunServer.length > 0) {
this.stunServer = stunServer.text();
console.log("Stun server: " + this.stunServer);
}

//variable participating in api load, can bee null, webrtc, flash
var streamingType = $(xml).find("streaming");
if (streamingType.length > 0) {
if (streamingType.text() == "webrtc") {
console.log("Force WebRTC usage!");
isWebRTCAvailable = true;
} else if (streamingType.text() == "flash") {
console.log("Force Flash usage!");
isWebRTCAvailable = false;
} else {
console.log("Bad streaming property " + streamingType.text() +
", can be webrtc or flash. Using default behaviour!")
}
}

//get load balancer url if load balancing enabled
if (me.loadBalancerUrl != null) {
trace("Retrieve server url from load balancer");
Expand All @@ -166,7 +215,7 @@ FlashphonerLoader.prototype = {
*/
setTimeout(function () {
//check status of ajax request
if (!this.jsonpSuccess) {
if (!me.jsonpSuccess) {
trace("Error occurred while retrieving load balancer data, please check your load balancer url " +
me.loadBalancerUrl);
me.loadAPI();
Expand All @@ -179,13 +228,15 @@ FlashphonerLoader.prototype = {
dataType: "jsonp",
data: loadBalancerData,
success: function (loadBalancerData) {
this.wcsIP = loadBalancerData.server;
this.wsPort = loadBalancerData.ws;
this.flashPort = loadBalancerData.flash;
this.jsonpSuccess = true;
me.wcsIP = loadBalancerData.server;
me.wsPort = loadBalancerData.ws;
me.wssPort = loadBalancerData.wss;
me.flashPort = loadBalancerData.flash;
me.jsonpSuccess = true;
trace("Connection data from load balancer: "
+ "wcsIP " + loadBalancerData.server
+ ", wsPort " + loadBalancerData.ws
+ ", wssPort " + loadBalancerData.wss
+ ", flashPort " + loadBalancerData.flash);
me.loadAPI();
}
Expand All @@ -199,10 +250,18 @@ FlashphonerLoader.prototype = {
var me = this;
if (isWebRTCAvailable) {
me.useWebRTC = true;
me.urlServer = "ws://" + this.wcsIP + ":" + this.wsPort;
var protocol = "ws://";
var port = this.wsPort;
if (this.useWss){
protocol = "wss://";
port = this.wssPort;
}
me.urlServer = protocol + this.wcsIP + ":" + port;
me.flashphoner = new WebSocketManager(getElement('localVideoPreview'), getElement('remoteVideo'));
if (me.stripCodecs.length) me.flashphoner.setStripCodecs(me.stripCodecs);
if (me.stunServer != "") me.flashphoner.setStunServer(me.stunServer);
me.flashphoner_UI = new UIManagerWebRtc();
notifyFlashReady();
notifyConfigLoaded();
} else {
me.useWebRTC = false;
me.urlServer = "rtmfp://" + this.wcsIP + ":" + this.flashPort + "/" + this.appName;
Expand All @@ -211,7 +270,14 @@ FlashphonerLoader.prototype = {
params.swliveconnect = "true";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
params.wmode = "transparent";
//in case of Safari wmode should be "window"
if((navigator.userAgent.indexOf("Safari") > -1) && !(navigator.userAgent.indexOf("Chrome") > -1)) {
params.wmode = "window";
//workaround for safari browser, FPNR-403
swfobject.switchOffAutoHideShow();
} else {
params.wmode = "transparent";
}
var attributes = {};
var flashvars = {};
flashvars.config = "flashphoner.xml";
Expand All @@ -221,6 +287,8 @@ FlashphonerLoader.prototype = {
me.flashphoner = e.ref;
me.flashphoner_UI = new UIManagerFlash();
});
} else {
notifyFlashNotFound();
}

}
Expand Down
Loading