Permalink
Browse files

Add hackWssInTransport to UA configuration to fix Asterisk problems. F…

…ixes #97
  • Loading branch information...
egreenmachine committed Oct 24, 2014
1 parent 240571a commit 32bffbea37d91d185851c46e930be8f663e52d13
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/UA.js
View
@@ -874,6 +874,7 @@ UA.prototype.loadConfig = function(configuration) {
// Hacks
hackViaTcp: false,
hackIpInContact: false,
hackWssInTransport: false,
//autostarting
autostart: true,
@@ -1005,7 +1006,7 @@ UA.prototype.loadConfig = function(configuration) {
this.contact = {
pub_gruu: null,
temp_gruu: null,
uri: new SIP.URI('sip', SIP.Utils.createRandomToken(8), settings.viaHost, null, {transport: 'ws'}),
uri: new SIP.URI('sip', SIP.Utils.createRandomToken(8), settings.viaHost, null, {transport: ((settings.hackWssInTransport)?'wss':'ws')}),
toString: function(options){
options = options || {};
@@ -1085,6 +1086,7 @@ UA.configuration_skeleton = (function() {
"displayName",
"hackViaTcp", // false.
"hackIpInContact", //false
"hackWssInTransport", //false
"instanceId",
"noAnswerTimeout", // 30 seconds.
"password",
@@ -1260,6 +1262,12 @@ UA.configuration_check = {
}
},
hackWssInTransport: function(hackWssInTransport) {
if (typeof hackWssInTransport === 'boolean') {
return hackWssInTransport;
}
},
instanceId: function(instanceId) {
if(typeof instanceId !== 'string') {
return;

0 comments on commit 32bffbe

Please sign in to comment.