sbc: make call-id of second leg configurable; $ci

sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent 9d35567fca
commit 19b43ec341

@ -127,6 +127,14 @@ string replaceParameters(const string& s,
replaceParsedParam(s, p, ruri_parser, res);
}; break;
case 'c': { // call-id
if ((s.length() == p+1) || (s[p+1] == 'i')) {
res += req.callid;
break;
}
WARN("unknown replacement $c%c\n", s[p+1]);
}
#define case_HDR(pv_char, pv_name, hdr_name) \
case pv_char: { \
AmUriParser uri_parser; \

@ -75,6 +75,8 @@ bool SBCCallProfile::readFromConfiguration(const string& name,
from = cfg.getParameter("From");
to = cfg.getParameter("To");
callid = cfg.getParameter("Call-ID");
force_outbound_proxy = cfg.getParameter("force_outbound_proxy") == "yes";
outbound_proxy = cfg.getParameter("outbound_proxy");
@ -200,6 +202,10 @@ bool SBCCallProfile::readFromConfiguration(const string& name,
INFO("SBC: RURI = '%s'\n", ruri.c_str());
INFO("SBC: From = '%s'\n", from.c_str());
INFO("SBC: To = '%s'\n", to.c_str());
if (!callid.empty()) {
INFO("SBC: Call-ID = '%s'\n", callid.c_str());
}
INFO("SBC: force outbound proxy: %s\n", force_outbound_proxy?"yes":"no");
INFO("SBC: outbound proxy = '%s'\n", outbound_proxy.c_str());
if (!next_hop_ip.empty()) {
@ -371,6 +377,9 @@ void SBCDialog::onInvite(const AmSipRequest& req)
to = call_profile.to.empty() ?
req.to : replaceParameters(call_profile.to, "To", REPLACE_VALS);
callid = call_profile.callid.empty() ?
"" : replaceParameters(call_profile.callid, "Call-ID", REPLACE_VALS);
if (!call_profile.outbound_proxy.empty()) {
call_profile.outbound_proxy =
replaceParameters(call_profile.outbound_proxy, "outbound_proxy", REPLACE_VALS);
@ -817,7 +826,8 @@ void SBCDialog::createCalleeSession()
other_id = AmSession::getNewId();
callee_dlg.local_tag = other_id;
callee_dlg.callid = AmSession::getNewId() + "@" + AmConfig::LocalIP;
callee_dlg.callid = callid.empty() ?
AmSession::getNewId() + "@" + AmConfig::LocalIP : callid;
// this will be overwritten by ConnectLeg event
callee_dlg.remote_party = to;

@ -48,6 +48,8 @@ struct SBCCallProfile {
string from; /* updated if set */
string to; /* updated if set */
string callid;
string outbound_proxy;
bool force_outbound_proxy;
@ -134,6 +136,7 @@ class SBCDialog : public AmB2BCallerSession
string ruri;
string from;
string to;
string callid;
unsigned int call_timer;
AmDynInvoke* m_user_timer;

@ -7,6 +7,9 @@
#From=$f
#To=$t
#Call-ID
#Call-ID=$ci_leg2
## routing
# outbound proxy:
#outbound_proxy=sip:192.168.5.106:5060

@ -14,7 +14,7 @@ Features
--------
o B2BUA
o flexible call profile based configuration
o From, To, RURI update
o From, To, RURI, Call-ID update
o Header and message filter
o reply code translation
o SIP authentication
@ -38,7 +38,7 @@ active_profile configuration option
By using the latter two options, the SBC profile for the call can be selected in the
proxy.
RURI, From, To - Replacement patterns
RURI, From, To, etc - Replacement patterns
-------------------------------------
In SBC profile the appearance of the outgoing INVITE request can be set,
by setting RURI, From and To parameters. If any of those parameters is not
@ -85,6 +85,8 @@ The patterns which can be used are the following:
...
$ci - Call-ID
$P(paramname) - paramname from P-App-Param
Example:
P-App-Param: u=myuser;p=mypwd;d=mydomain
@ -127,6 +129,20 @@ If a space is contained, use quotation at the beginning and end.
Example:
To="\"someone\" <$aU@mytodomain.com>"
Setting Call-ID
---------------
For debugging purposes, the call-id of the outgoing leg can be set to depend on
the call-id the first leg, by setting the Call-ID parameter.
Example:
Call-ID=$ci_leg2
If the incoming call leg had "Call-ID: 3c2d4b9a6b6f-hb22s7k9n0iv", the outgoing
leg will have "Call-ID: 3c2d4b9a6b6f-hb22s7k9n0iv_leg2".
If Call-ID is not set, a standard unique ID is generated by SEMS, of the form
UUID@host-ip.
Outbound proxy and next hop
---------------------------

Loading…
Cancel
Save