sbc: make next_hop_for_replies dynamic

sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent 660f23aa83
commit 677e31237d

@ -538,6 +538,12 @@ void SBCDialog::onInvite(const AmSipRequest& req)
}
call_profile.next_hop_port_i = nh_port_i;
DBG("set next hop port to '%u'\n", call_profile.next_hop_port_i);
if (!call_profile.next_hop_for_replies.empty()) {
call_profile.next_hop_for_replies =
replaceParameters(call_profile.next_hop_for_replies, "next_hop_for_replies",
REPLACE_VALS);
}
}
}
@ -961,7 +967,12 @@ void SBCDialog::createCalleeSession()
callee_dlg.next_hop_ip = call_profile.next_hop_ip;
callee_dlg.next_hop_port = call_profile.next_hop_port.empty() ?
5060 : call_profile.next_hop_port_i;
callee_dlg.next_hop_for_replies = call_profile.next_hop_for_replies;
if (!call_profile.next_hop_for_replies.empty()) {
callee_dlg.next_hop_for_replies =
(call_profile.next_hop_for_replies == "yes" ||
call_profile.next_hop_for_replies == "1");
}
}
other_id = AmSession::getNewId();

@ -52,7 +52,7 @@ bool SBCCallProfile::readFromConfiguration(const string& name,
next_hop_ip = cfg.getParameter("next_hop_ip");
next_hop_port = cfg.getParameter("next_hop_port");
next_hop_for_replies = cfg.getParameter("next_hop_for_replies") == "yes";
next_hop_for_replies = cfg.getParameter("next_hop_for_replies");
string hf_type = cfg.getParameter("header_filter", "transparent");
if (hf_type=="transparent")
@ -196,8 +196,8 @@ bool SBCCallProfile::readFromConfiguration(const string& name,
INFO("SBC: next hop = %s%s\n", next_hop_ip.c_str(),
next_hop_port.empty()? "" : (":"+next_hop_port).c_str());
if (next_hop_for_replies) {
INFO("SBC: next hop used for replies\n");
if (!next_hop_for_replies.empty()) {
INFO("SBC: next hop used for replies: '%s'\n", next_hop_for_replies.c_str());
}
}
@ -307,7 +307,7 @@ string SBCCallProfile::print() const {
res += "next_hop_ip: " + next_hop_ip + "\n";
res += "next_hop_port: " + next_hop_port + "\n";
res += "next_hop_port_i: " + int2str(next_hop_port_i) + "\n";
res += "next_hop_for_replies: " + string(next_hop_for_replies?"true":"false") + "\n";
res += "next_hop_for_replies: " + next_hop_for_replies + "\n";
res += "headerfilter: " + string(FilterType2String(headerfilter)) + "\n";
res += "headerfilter_list: " + stringset_print(headerfilter_list) + "\n";
res += "messagefilter: " + string(FilterType2String(messagefilter)) + "\n";

@ -56,7 +56,7 @@ struct SBCCallProfile {
string next_hop_ip;
string next_hop_port;
unsigned short next_hop_port_i;
bool next_hop_for_replies;
string next_hop_for_replies;
FilterType headerfilter;
set<string> headerfilter_list;

Loading…
Cancel
Save