{
"nodeId" : "fTS3zN0ouFNT9Nzji5y6SSCaupOLzscL@188.40.244.249",
"appKey" : "defaultApp",
"sessionId" : "/115.221.214.167:37018/188.40.244.249:8443-8f47f720-e7b3-4ae0-b4aa-6f139d562700",
"sipRegisterRequired" : true,
"sipLogin" : "10001",
"sipAuthenticationName" : "10001",
"sipPassword" : "xaPK345iGjv5458",
"sipDomain" : "voip.mycompany.com",
"sipOutboundProxy" : "voip.mycompany.com",
"sipPort" : 5060,
"useWsTunnel" : false,
"useWsTunnelPacketization2" : false,
"msePacketizationVersion" : 2,
"useBase64BinaryEncoding" : false,
"mediaProviders" : [ "WebRTC", "MSE", "WSPlayer" ],
"clientVersion" : "2.0",
"clientOSVersion" : "5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
"clientBrowserVersion" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
"keepAlive" : true,
"origin" : "https://demo.flashphoner.com"
}
{
"nodeId" : "fTS3zN0ouFNT9Nzji5y6SSCaupOLzscL@188.40.244.249",
"appKey" : "defaultApp",
"sessionId" : "/115.221.214.167:37018/188.40.244.249:8443-8f47f720-e7b3-4ae0-b4aa-6f139d562700",
"sipRegisterRequired" : true,
"sipLogin" : "10001",
"sipAuthenticationName" : "10001",
"sipPassword" : "xaPK345iGjv5458",
"sipDomain" : "voip.mycompany.com",
"sipOutboundProxy" : "voip.mycompany.com",
"sipPort" : 5060,
"useWsTunnel" : false,
"useWsTunnelPacketization2" : false,
"msePacketizationVersion" : 2,
"useBase64BinaryEncoding" : false,
"mediaProviders" : [ "WebRTC", "MSE", "WSPlayer" ],
"restClientConfig" : {
"ConnectionStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"RegistrationStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"sendXcapRequest" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"XcapStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"sendDtmf" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"call" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"OnCallEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"answer" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"hangup" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"hold" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"unhold" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"transfer" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"OnTransferEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"TransferStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"CallStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"sendMessage" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"OnMessageEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"MessageStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"publishStream" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"unPublishStream" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"playStream" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"stopStream" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"StreamStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"subscribe" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"SubscriptionStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"OnDataEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"DataStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"submitBugReport" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"BugReportStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"pushLogs" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"RecordingStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"ErrorStatusEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"disconnect" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
},
"StreamKeepAliveEvent" : {
"restExclude" : "",
"clientExclude" : "",
"restOverwrite" : "",
"restOnError" : "FAIL",
"restPolicy" : "NOTIFY"
}
},
"clientVersion" : "2.0",
"clientOSVersion" : "5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
"clientBrowserVersion" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
"keepAlive" : true,
"origin" : "https://demo.flashphoner.com"
}
You don't need to set up a new WCS instance to make a calls via another PBX. You can just use a SIP outbound proxy needed as we described above. In this case all WebRTC traffic goes through single WCS instance, but SIP traffic goes through selected PBX.I wish to create something like wss://pbx1web.xposeurope.eu:8443 & wss://pbx2web.xposeurope.eu:8443
To send traffic over my two Freepbx installations also located on AWS Germany and Ireland
If you want to separate a SIP calls depending on server address, you should check theI can create the new pbx1web and pbx2web fwd in godaddy for this but I am not sure what is needed for WSS to work with freepbx as such.
Origin
header in you Javascript code and set up SIP credentials depending on the header value.outbound_proxy = my.pbx.com
outbound_port = 5060
var outboundProxy;
if (window.location.hostname === "pbx1web.xposeurope.eu") {
outboundProxy = "ebtspbx1.xposeurope.eu";
} else if (window.location.hostname === "pbx2web.xposeurope.eu") {
outboundProxy = "ebtspbx2.xposeurope.eu";
}
var sipOptions = {
login: sipLogin,
authenticationName: sipLogin,
password: sipPassword,
domain: outboundProxy,
outboundProxy: outboundProxy,
port: sipPort,
registerRequired: true
};
var connectionOptions = {
urlServer: url,
keepAlive: true
sipOptions: sipOptions
};
//create session
console.log("Create new session with url " + url);
Flashphoner.createSession(connectionOptions).on(SESSION_STATUS.ESTABLISHED, function(session, connection){
setStatus("#regStatus", SESSION_STATUS.ESTABLISHED);
$("#authToken").val(connection.authToken);
onConnected(session);
if (!registerRequired) {
disableOutgoing(false);
}
}).on(SESSION_STATUS.REGISTERED, function(session){
...
});
}
pbx1web.xposeurope.eu
and pbx2web.xposeurope.eu
to place a web page with a modified Javascript codeRegistrationStatusEvent
REST hook to check if connection to PBX is successful. Your backend receives ConnectionStatusEvent
then RegistrationStatusEvent
if PBX is available and ConnectionStatusEvent
only if not08:16:53,523 INFO RestClient - API-ASYNC-pool-7-thread-16 SEND REST OBJECT ==>
URL:http://localhost:8081/apps/EchoApp/ConnectionStatusEvent
OBJECT:
{
"nodeId" : "d2hxbqNPE04vGeZ51NPhDuId6k3hUrBB@95.191.130.39",
"appKey" : "defaultApp",
"sessionId" : "/*.*.*.*:50150/*.*.*.*:8443-21d8ffe5-add4-497d-a484-c0dee0dde05a",
"sipRegisterRequired" : true,
"sipLogin" : "10006",
"sipAuthenticationName" : "10006",
"sipPassword" : "*******",
"sipDomain" : "pbx1.flashphoner.com",
"sipOutboundProxy" : "pbx1.flashphoner.com",
"sipPort" : 5060,
"useWsTunnel" : false,
"useWsTunnelPacketization2" : false,
"msePacketizationVersion" : 2,
"useBase64BinaryEncoding" : false,
"mediaProviders" : [ "WebRTC", "MSE", "WSPlayer" ],
"authToken" : "42e0ed52-bb95-49c4-88a7-cf3ad729b910",
"status" : "ESTABLISHED",
"clientVersion" : "2.0",
"clientOSVersion" : "5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
"clientBrowserVersion" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
"keepAlive" : true,
"origin" : "https://wcs:8444"
}
...
08:16:53,766 INFO RestClient - API-ASYNC-pool-7-thread-14 SEND REST OBJECT ==>
URL:http://localhost:8081/apps/EchoApp/RegistrationStatusEvent
OBJECT:
{
"nodeId" : "d2hxbqNPE04vGeZ51NPhDuId6k3hUrBB@95.191.130.39",
"appKey" : "defaultApp",
"sessionId" : "/*.*.*.*:50150/*.*.*.*:8443-21d8ffe5-add4-497d-a484-c0dee0dde05a",
"status" : "REGISTERED"
}
REGISTERED
status, you can make a call. Otherwise, you should disconnect the session and try to register to pbx2.