adds next_hop core config option

sayer/1.4-spce2.6
Stefan Sayer 15 years ago
parent 85be85f0ea
commit 351e9fe447

@ -72,6 +72,9 @@ int AmConfig::MediaProcessorThreads = NUM_MEDIA_PROCESSORS;
int AmConfig::SIPServerThreads = NUM_SIP_SERVERS;
string AmConfig::OutboundProxy = "";
bool AmConfig::ForceOutboundProxy = false;
string AmConfig::NextHopIP = "";
unsigned int AmConfig::NextHopPort = 0;
bool AmConfig::NextHopForReplies = false;
bool AmConfig::ProxyStickyAuth = false;
bool AmConfig::DisableDNSSRV = false;
string AmConfig::Signature = "";
@ -285,6 +288,18 @@ int AmConfig::readConfiguration()
ForceOutboundProxy = (cfg.getParameter("force_outbound_proxy") == "yes");
}
if(cfg.hasParameter("next_hop_ip")) {
NextHopIP = cfg.getParameter("next_hop_ip");
}
if(cfg.hasParameter("next_hop_port")) {
NextHopPort = cfg.getParameterInt("next_hop_port", 0);
}
if(cfg.hasParameter("next_hop_for_replies")) {
NextHopForReplies = (cfg.getParameter("next_hop_for_replies") == "yes");
}
if(cfg.hasParameter("proxy_sticky_auth")) {
ProxyStickyAuth = (cfg.getParameter("proxy_sticky_auth") == "yes");
}

@ -126,6 +126,12 @@ struct AmConfig
static string OutboundProxy;
/** force Outbound Proxy to be used for in dialog requests */
static bool ForceOutboundProxy;
/** force next hop IP */
static string NextHopIP;
/** force next hop port */
static unsigned int NextHopPort;
/** force next hop for replies, too */
static bool NextHopForReplies;
/** update ruri-host to previously resolved IP:port on SIP auth */
static bool ProxyStickyAuth;
/** skip DNS SRV lookup for resolving destination address*/

@ -49,7 +49,9 @@ AmSipDialog::AmSipDialog(AmSipDialogEventHandler* h)
force_outbound_proxy(AmConfig::ForceOutboundProxy),
reliable_1xx(AmConfig::rel100),
rseq(0), rseq_1st(0), rseq_confirmed(false),
next_hop_port(0), next_hop_for_replies(false),
next_hop_port(AmConfig::NextHopPort),
next_hop_ip(AmConfig::NextHopIP),
next_hop_for_replies(AmConfig::NextHopForReplies),
outbound_interface(-1), out_intf_for_replies(false)
{
}

@ -86,14 +86,31 @@ sip_port=5080
# optional parameter: force_outbound_proxy={yes|no}
#
# - forces SEMS to send any request to the outbound proxy in any
# situation. This option will only have an effect if the
# outbound_proxy option has been set.
# situation, by adding an extra first Route to the outbound_proxy.
# This option will only have an effect if the outbound_proxy
# option has been set, and it will break 3261 compatibility
# in some cases; better use next_hop_ip/next_hop_port.
#
# default: no
#
# Example:
# force_outbound_proxy=yes
# optional parameter: next_hop_ip
# - if this is set, all outgoing requests will be sent to
# this IP, regardless of R-URI etc.
#
#next_hop_ip=192.168.5.106
# optional parameter: next_hop_port
# defaults to 5060
#next_hop_port=5060
# optional parameter:next_hop_for_replies
# - use next_hop for replies, too?
#
#next_hop_for_replies=yes
# optional parameter: rtp_low_port=<port>
#
# - sets lowest for RTP used port

Loading…
Cancel
Save