@@ -905,6 +905,7 @@ UA.prototype.loadConfig = function(configuration) {
905905 hackIpInContact : false ,
906906 hackWssInTransport : false ,
907907
908+ contactTransport : 'ws' ,
908909 forceRport : false ,
909910
910911 //autostarting
@@ -1043,10 +1044,15 @@ UA.prototype.loadConfig = function(configuration) {
10431044 }
10441045 }
10451046
1047+ // Contact transport parameter
1048+ if ( settings . hackWssInTransport ) {
1049+ settings . contactTransport = 'wss' ;
1050+ }
1051+
10461052 this . contact = {
10471053 pub_gruu : null ,
10481054 temp_gruu : null ,
1049- uri : new SIP . URI ( 'sip' , SIP . Utils . createRandomToken ( 8 ) , settings . viaHost , null , { transport : ( ( settings . hackWssInTransport ) ? 'wss' : 'ws' ) } ) ,
1055+ uri : new SIP . URI ( 'sip' , SIP . Utils . createRandomToken ( 8 ) , settings . viaHost , null , { transport : settings . contactTransport } ) ,
10501056 toString : function ( options ) {
10511057 options = options || { } ;
10521058
@@ -1056,7 +1062,7 @@ UA.prototype.loadConfig = function(configuration) {
10561062 contact = '<' ;
10571063
10581064 if ( anonymous ) {
1059- contact += ( this . temp_gruu || ( 'sip:[email protected] ;transport=' + ( settings . hackWssInTransport ) ? 'wss' : 'ws' ) ) . toString ( ) ; 1065+ contact += ( this . temp_gruu || ( 'sip:[email protected] ;transport=' + settings . contactTransport ) ) . toString ( ) ; 10601066 } else {
10611067 contact += ( this . pub_gruu || this . uri ) . toString ( ) ;
10621068 }
@@ -1128,6 +1134,7 @@ UA.configuration_skeleton = (function() {
11281134 "hackViaTcp" , // false.
11291135 "hackIpInContact" , //false
11301136 "hackWssInTransport" , //false
1137+ "contactTransport" , // 'ws'
11311138 "forceRport" , // false
11321139 "iceCheckingTimeout" ,
11331140 "instanceId" ,
@@ -1324,6 +1331,12 @@ UA.configuration_check = {
13241331 }
13251332 } ,
13261333
1334+ contactTransport : function ( contactTransport ) {
1335+ if ( typeof contactTransport === 'string' ) {
1336+ return contactTransport ;
1337+ }
1338+ } ,
1339+
13271340 forceRport : function ( forceRport ) {
13281341 if ( typeof forceRport === 'boolean' ) {
13291342 return forceRport ;
0 commit comments