Skip to content

Commit

Permalink
Make preloaded Route header optional.
Browse files Browse the repository at this point in the history
New configuration parameter 'use_preloaded_route'

Preload Route header with the outbound proxy only if this parameter is set to *true*
  • Loading branch information
jmillan committed Dec 7, 2012
1 parent defeabe commit 24fcdbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SIPMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ JsSIP.OutgoingRequest = function(method, ruri, ua, params, extraHeaders, body) {
//ROUTE
if (params.route_set) {
this.setHeader('route', params.route_set);
} else {
} else if (ua.configuration.use_preloaded_route){
this.setHeader('route', ua.transport.server.sip_uri);
}

Expand Down
11 changes: 11 additions & 0 deletions src/UA.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ JsSIP.UA.prototype.loadConfig = function(configuration) {
connection_recovery_min_interval: 2,
connection_recovery_max_interval: 30,

use_preloaded_route: false,

// Session parameters
no_answer_timeout: 60,
stun_server: 'stun.l.google.com:19302',
Expand Down Expand Up @@ -778,6 +780,8 @@ JsSIP.UA.configuration_skeleton = (function() {
"connection_recovery_min_interval",
"connection_recovery_max_interval",

"use_preloaded_route",

"register_min_expires",

// Mandatory user configurable parameters
Expand Down Expand Up @@ -956,6 +960,13 @@ JsSIP.UA.configuration_check = {
return true;
}
},
use_preloaded_route: function(use_preloaded_route) {
if(typeof use_preloaded_route !== 'boolean') {
return false;
} else {
return true;
}
},
hack_via_tcp: function(hack_via_tcp) {
if(typeof hack_via_tcp !== 'boolean') {
return false;
Expand Down

0 comments on commit 24fcdbb

Please sign in to comment.