[html5/audio] Add hackViaWs to SIP.js and make it configurable in settings.yml, 1002 workaround

This adds the possibility to configure the SIP Via header to plain WS to allow reverse proxying from WSS to WS, internally, to work around a bug in freeswitch where the WSS stack would get deadlocked due to a still unidentified bug in there that has to do with SSL termination
This commit is contained in:
prlanzarin 2020-11-10 12:41:48 +00:00
parent 6383af3667
commit a1f0276b64
3 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,7 @@ const MEDIA_TAG = MEDIA.mediaTag;
const CALL_TRANSFER_TIMEOUT = MEDIA.callTransferTimeout;
const CALL_HANGUP_TIMEOUT = MEDIA.callHangupTimeout;
const CALL_HANGUP_MAX_RETRIES = MEDIA.callHangupMaximumRetries;
const SIPJS_HACK_VIA_WS = MEDIA.sipjsHackViaWs;
const IPV4_FALLBACK_DOMAIN = Meteor.settings.public.app.ipv4FallbackDomain;
const CALL_CONNECT_TIMEOUT = 20000;
const ICE_NEGOTIATION_TIMEOUT = 20000;
@ -379,6 +380,7 @@ class SIPSession {
displayName: callerIdName,
register: false,
userAgentString: 'BigBlueButton',
hackViaWs: SIPJS_HACK_VIA_WS,
});
const handleUserAgentConnection = () => {

View File

@ -289,6 +289,7 @@ public:
#so far. Increasing this value might help avoiding 1004 error when
#user activates microphone.
iceGatheringTimeout: 5000
sipjsHackViaWs: false
presentation:
defaultPresentationFile: default.pdf
panZoomThrottle: 32

View File

@ -3831,6 +3831,7 @@ class OutgoingRequestMessage {
fromTag: "",
forceRport: false,
hackViaTcp: false,
hackViaWs: false,
optionTags: ["outbound"],
routeSet: [],
userAgentString: "sip.js",
@ -3937,6 +3938,8 @@ class OutgoingRequestMessage {
// FIXME: Hack
if (this.options.hackViaTcp) {
transport = "TCP";
} else if (this.options.hackViaWs) {
transport = "WS";
}
let via = "SIP/2.0/" + transport;
via += " " + this.options.viaHost + ";branch=" + branch;
@ -9812,6 +9815,7 @@ class UserAgentCore {
const fromDisplayName = this.configuration.displayName;
const forceRport = this.configuration.viaForceRport;
const hackViaTcp = this.configuration.hackViaTcp;
const hackViaWs = this.configuration.hackViaWs;
const optionTags = this.configuration.supportedOptionTags.slice();
if (method === _messages__WEBPACK_IMPORTED_MODULE_0__["C"].REGISTER) {
optionTags.push("path", "gruu");
@ -9827,6 +9831,7 @@ class UserAgentCore {
forceRport,
fromDisplayName,
hackViaTcp,
hackViaWs,
optionTags,
routeSet,
userAgentString,
@ -17303,6 +17308,7 @@ class UserAgent {
hackAllowUnregisteredOptionTags: false,
hackIpInContact: false,
hackViaTcp: false,
hackViaWs: false,
hackWssInTransport: false,
logBuiltinEnabled: true,
logConfiguration: true,
@ -17657,6 +17663,7 @@ class UserAgent {
displayName: this.options.displayName,
loggerFactory: this.loggerFactory,
hackViaTcp: this.options.hackViaTcp,
hackViaWs: this.options.hackViaWs,
routeSet: this.options.preloadedRouteSet,
supportedOptionTags,
supportedOptionTagsResponse,