How to configure WCS5 for Freepbx

Max

Administrator
Staff member
Hello

1. You can pass account details directly to JavaScript

- SIP username
- SIP authname
- SIP password
- SIP domain
- SIP proxy
- SIP port

2. You can implement custom /connect endpoint

WCS will call your /connect endpoint, i.e.

POST

Your endpoint should reply 200 OK and SIP details

Full request response examples:

Code:
{
  "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"
}
Code:
{
  "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"
}
 
Last edited:

JBDiesel

New Member
Perhaps I am not stating what I need correctly.
We already have: wss://ebtsweb.xposeurope.eu:8443 as u have previously helped me with and it is Working but this is direct to my provider going around my Freepbx system.

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

I 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.

Many thanks in Advance,

Jason
 

Max

Administrator
Staff member
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
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 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.
If you want to separate a SIP calls depending on server address, you should check the Origin header in you Javascript code and set up SIP credentials depending on the header value.
 

Max

Administrator
Staff member
If you want just force particular PBX, you can add two lines into config file /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties
Then restart server process: systemctl restart webcallserver

Code:
outbound_proxy = my.pbx.com
outbound_port = 5060
Here my.pbx.com - is IPv4 address or FQDN (domain name) of your PBX server.
 
Top