diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp index e223db84..a47d0f04 100644 --- a/core/AmConfig.cpp +++ b/core/AmConfig.cpp @@ -171,19 +171,21 @@ int AmConfig::readConfiguration() if(!ModConfigPath.empty() && (ModConfigPath[ModConfigPath.length()-1] != '/')) ModConfigPath += '/'; - // local_ip - LocalIP = cfg.getParameter("listen"); - + // listen, sip_ip, sip_port, and media_ip + if(cfg.hasParameter("sip_ip")) { + LocalSIPIP = cfg.getParameter("sip_ip"); + } if(cfg.hasParameter("sip_port")){ if(!setSIPPort(cfg.getParameter("sip_port").c_str())){ ERROR("invalid sip port specified\n"); return -1; } } + if(cfg.hasParameter("media_ip")) { + LocalIP = cfg.getParameter("media_ip"); + } - if(cfg.hasParameter("sip_ip")) - LocalSIPIP = cfg.getParameter("sip_ip"); - + // public_ip if(cfg.hasParameter("public_ip")){ string p_ip = cfg.getParameter("public_ip"); DBG("Setting public_ip parameter to %s.\n", p_ip.c_str()); diff --git a/core/etc/sems.conf.sample b/core/etc/sems.conf.sample index 57cae5c8..83e9e490 100644 --- a/core/etc/sems.conf.sample +++ b/core/etc/sems.conf.sample @@ -149,17 +149,14 @@ media_processor_threads=1 # Example: # session_limit="1000;503;Server overload" -# optional parameter: listen=| +# optional parameter: media_ip=| # -# - this informs SEMS about the interface where its SER is -# bound to. SEMS needs this information to correctly set -# the contact header in outgoing calls and registrations. -# Should be set to equal the 'listen' configuration option -# in ser_sems.cfg. -# If not set, this defaults to the interface SEMS binds to. +# - this informs SEMS about the IP address or interface that SEMS uses +# to send and receive media. If not set, defaults to first non-loopback +# interface. # Examples: -# listen=10.0.0.34 -# listen=eth0 +# media_ip=10.0.0.34 +# media_ip=eth0 # optional parameter: sip_ip= # @@ -167,15 +164,12 @@ media_processor_threads=1 # bound to or should be bound to. If 'sipctrl' SIP stack is used, # the SIP stack will bind to this address. This also sets # the value used for contact header in outgoing calls and -# registrations. -# It defaults to the value of 'listen' (see above). +# registrations. If not set, defaults to first non-loopback +# interface. # # Example: # sip_ip=10.0.0.34 # -# default: -# -#sip_ip=10.0.0.34 # optional parameter: public_ip= # @@ -221,10 +215,8 @@ sip_port=5080 # # default: empty # -# example: +# Example: # outbound_proxy=sip:proxy.mydomain.net -# -#outbound_proxy=sip:192.168.0.1 # optional parameter: dead_rtp_time= # diff --git a/core/sems.cpp b/core/sems.cpp index a83c583b..e14a2dbb 100644 --- a/core/sems.cpp +++ b/core/sems.cpp @@ -257,6 +257,7 @@ int main(int argc, char* argv[]) " public media IP: %s\n" " local SIP port: %i\n" " local media IP: %s\n" + " outbound proxy: %s\n" " application: %s\n" "\n", AmConfig::ConfigurationFile.c_str(), @@ -266,6 +267,7 @@ int main(int argc, char* argv[]) AmConfig::PublicIP.c_str(), AmConfig::LocalSIPPort, AmConfig::LocalIP.c_str(), + AmConfig::OutboundProxy.c_str(), AmConfig::Application.empty()? "":AmConfig::Application.c_str() );