adds optional outbound_proxy, the next_hop for dialogs initiated by SEMS

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@503 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent b7aba681ff
commit 0e9bc0366a

@ -94,12 +94,12 @@ void SIPRegistration::doRegistration() {
req.r_uri = "sip:"+info.domain;
dlg.remote_uri = req.r_uri;
// set outbound proxy as next hop
// if (!AmConfig::OutboundProxy.empty())
// dlg.next_hop = AmConfig::OutboundProxy;
// else
// dlg.next_hop = "";
dlg.sendRequest(req.method, "", "", "Expires: 240\n");
if (!AmConfig::OutboundProxy.empty())
dlg.next_hop = AmConfig::OutboundProxy;
else
dlg.next_hop = "";
dlg.sendRequest(req.method, "", "", "Expires: 1000\n");
// save TS
struct timeval now;
@ -113,11 +113,13 @@ void SIPRegistration::doUnregister() {
dlg.remote_tag = "";
req.r_uri = "sip:"+info.domain;
dlg.remote_uri = req.r_uri;
// set outbound proxy as next hop
// if (!AmConfig::OutboundProxy.empty())
// dlg.next_hop = AmConfig::OutboundProxy;
// else
// dlg.next_hop = "";
if (!AmConfig::OutboundProxy.empty())
dlg.next_hop = AmConfig::OutboundProxy;
else
dlg.next_hop = "";
dlg.sendRequest(req.method, "", "", "Expires: 0\n");
// save TS

@ -55,6 +55,7 @@ int AmConfig::RtpHighPort = RTP_HIGHPORT;
int AmConfig::MediaProcessorThreads = NUM_MEDIA_PROCESSORS;
int AmConfig::LocalSIPPort = 5060;
string AmConfig::LocalSIPIP = "";
string AmConfig::OutboundProxy = "";
string AmConfig::Signature = "";
bool AmConfig::SingleCodecInOK = false;
unsigned int AmConfig::DeadRtpTime = DEAD_RTP_TIME;
@ -182,6 +183,9 @@ int AmConfig::readConfiguration()
}
}
// outbound_proxy
OutboundProxy = cfg.getParameter("outbound_proxy");
// socket_name
SocketName = cfg.getParameter("socket_name");

@ -83,6 +83,8 @@ struct AmConfig
static string LocalSIPIP;
/** the port SIP requests are sent from - optional (default 5060) */
static int LocalSIPPort;
/** Outbound Proxy (optional, outgoing calls only) */
static string OutboundProxy;
/** Server/User-Agent header (optional) */
static string Signature;
/** If 200 OK reply should be limited to preferred codec only */

@ -57,6 +57,10 @@ AmSession* AmUAC::dialout(const string& user,
req.to_tag = "";
req.callid = AmSession::getNewId() + "@" + AmConfig::LocalIP;
// set outbound proxy as next hop
if (!AmConfig::OutboundProxy.empty())
req.next_hop = AmConfig::OutboundProxy;
return AmSessionContainer::instance()->startSessionUAC(req, session_params);
}

@ -131,6 +131,27 @@ media_processor_threads=1
#
#sip_port=5060
# optional parameter: outbound_proxy=uri
#
# - this sets a next hop for calls and registrations outgoing
# from SEMS. This does not apply to requests in a dialog that
# is initiated by someone else and incoming to SEMS, as in
# this case the next_hop is taken by SEMS from the incoming
# request that established the dialog.
# If this is not set (default setting), then for dialogs
# initiated by SEMS the r-uri is resolved and the request
# is sent there directly.
# This is resolved by the SIP stack with DNS if a name is given.
# Warning: If the value set here can not be resolved, no
# requests will be sent out at all!
#
# default: empty
#
# example:
# outbound_proxy=sip:proxy.mydomain.net
#
#outbound_proxy=sip:192.168.0.1
# optional parameter: dead_rtp_time=<unsigned int>
#
# - if != 0, after this time (in seconds) of no RTP

Loading…
Cancel
Save