support for setting the outbound_interface.

sayer/1.4-spce2.6
Raphael Coeffic 15 years ago
parent c5105256b7
commit be0c1af70f

@ -1017,6 +1017,9 @@ void SBCDialog::createCalleeSession()
}
}
if(call_profile.outbound_interface >= 0)
callee_dlg.outbound_interface = call_profile.outbound_interface;
other_id = AmSession::getNewId();
callee_dlg.local_tag = other_id;

@ -30,7 +30,7 @@
#include "log.h"
#include "AmUtils.h"
#include "AmPlugIn.h"
#include "AmConfig.h"
bool SBCCallProfile::readFromConfiguration(const string& name,
const string profile_file_name) {
@ -177,6 +177,24 @@ bool SBCCallProfile::readFromConfiguration(const string& name,
force_symmetric_rtp = cfg.getParameter("rtprelay_force_symmetric_rtp");
msgflags_symmetric_rtp = cfg.getParameter("rtprelay_msgflags_symmetric_rtp") == "yes";
string out_if_str = cfg.getParameter("outbound_interface");
if(!out_if_str.empty()) {
if(out_if_str == "default")
outbound_interface = 0;
else {
map<string,unsigned short>::iterator name_it = AmConfig::If_names.find(out_if_str);
if(name_it != AmConfig::If_names.end()) {
outbound_interface = name_it->second;
}
else {
ERROR("%s: '%s' does not exist as an interface. "
"Please check the 'additional_interfaces' "
"parameter in the main configuration file.",
name.c_str(),out_if_str.c_str());
}
}
}
md5hash = "<unknown>";
if (!cfg.getMD5(profile_file_name, md5hash)){
ERROR("calculating MD5 of file %s\n", profile_file_name.c_str());

@ -92,6 +92,8 @@ struct SBCCallProfile {
string force_symmetric_rtp;
bool msgflags_symmetric_rtp;
int outbound_interface;
// todo: RTP transcoding mode
SBCCallProfile()
@ -103,7 +105,8 @@ struct SBCCallProfile {
auth_enabled(false),
call_timer_enabled(false),
prepaid_enabled(false),
rtprelay_enabled(false)
rtprelay_enabled(false),
outbound_interface(-1)
{ }

Loading…
Cancel
Save