sipctrl using LocalSIPIP/LocalSIPPort. LocalSIPIP a config option (sip_ip)

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

@ -184,6 +184,9 @@ int AmConfig::readConfiguration()
}
}
if(cfg.hasParameter("sip_ip"))
LocalSIPIP = cfg.getParameter("sip_ip");
// outbound_proxy
OutboundProxy = cfg.getParameter("outbound_proxy");

@ -65,8 +65,7 @@ plugin_path=/usr/local/lib/sems/plug-in/
# ('blacklist'). This has only effect it load_plugins is empty.
# If empty, all modules in plugin_path are loaded.
#
exclude_plugins=binrpcctrl;
exclude_plugins=binrpcctrl;sipctrl;
# optional parameter: exclude_payloads=<payload list>
#
@ -120,15 +119,31 @@ media_processor_threads=1
# listen=10.0.0.34
# listen=eth0
# optional parameter: sip_ip=<ip_address>
#
# - this informs SEMS about the SIP IP where its SIP stack is
# 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).
#
# Example :
# sip_ip=10.0.0.34
#
# default: <listen ip address>
#
#sip_ip=10.0.0.34
# optional parameter: sip_port=<port_number>
#
# - this informs SEMS about the port 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 'port' configuration option
# in ser_sems.cfg.
# This does not need to be set if outgoing calls and
# registrations from SEMS are not used.
# - this informs SEMS about the port where its SIP stack is
# bound to or should be bound to. SEMS needs this information
# to correctly set the contact header in outgoing calls
# and registrations. Should be set to equal the 'port'
# configuration option in ser_sems.cfg.
# This does not need to be set if sipctrl SIP stack, outgoing
# calls and registrations from SEMS are not used.
#
# default: 5060
#

@ -44,24 +44,11 @@ AmCtrlInterface* SipCtrlInterfaceFactory::instance()
int SipCtrlInterfaceFactory::onLoad()
{
AmConfigReader cfg;
bind_addr = AmConfig::LocalSIPIP;
bind_port = AmConfig::LocalSIPPort;
if (cfg.loadFile(AmConfig::ModConfigPath + string(MOD_NAME ".conf"))) {
WARN("failed to read/parse config file `%s' - assuming defaults\n",
(AmConfig::ModConfigPath + string(MOD_NAME ".conf")).c_str());
bind_addr = AmConfig::LocalIP;
bind_port = AmConfig::LocalSIPPort;
}
else {
bind_addr = cfg.getParameter("bind_addr", AmConfig::LocalIP);
bind_port = cfg.getParameterInt("bind_port", AmConfig::LocalSIPPort);
}
INFO("bind_addr: `%s'.\n", bind_addr.c_str());
INFO("bind_port: `%i'.\n", bind_port);
INFO("SIP bind_addr: `%s'.\n", bind_addr.c_str());
INFO("SIP bind_port: `%i'.\n", bind_port);
return 0;

@ -242,19 +242,25 @@ int main(int argc, char* argv[])
}
AmConfig::LocalIP = getLocalIP(AmConfig::LocalIP);
AmConfig::LocalSIPIP = AmConfig::LocalIP;
if (AmConfig::LocalSIPIP.empty()) {
AmConfig::LocalSIPIP = AmConfig::LocalIP;
}
print_version();
printf( "\n\nConfiguration:\n"
" configuration file: %s\n"
" plug-in path: %s\n"
" daemon mode: %i\n"
" local IP: %s\n"
" local SIP IP: %s\n"
" local SIP port: %i\n"
" local media IP: %s\n"
" default application: %s\n"
"\n",
AmConfig::ConfigurationFile.c_str(),
AmConfig::PlugInPath.c_str(),
AmConfig::DaemonMode,
AmConfig::LocalSIPIP.c_str(),
AmConfig::LocalSIPPort,
AmConfig::LocalIP.c_str(),
AmConfig::DefaultApplication.empty()?
"<not set>":AmConfig::DefaultApplication.c_str()

Loading…
Cancel
Save