* Added transparent_destination conf parameter to b2b_connect

application.  If set to true, Request URI and To URI are passed
  unaltered to the second leg.


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1411 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Juha Heinanen 17 years ago
parent d682e68fcd
commit 8564e378f0

@ -25,4 +25,9 @@ This will result in sems trying to set up a call to john@ser.mydomain.com:5060.
If a 407 Authentication required is received, semsuser and 'password' will be
used as credentials.
Improvements are of course welcome as svn diff to the semsdev mailing list.
If b2b_connect.conf parameter transparent_destination is set to true
(default is false), then Request URI and To URI are passed to the second
leg unaltered.
Improvements are of course welcome as svn diff to the semsdev mailing
list.

@ -34,6 +34,7 @@
#include "AmSessionContainer.h"
bool b2b_connectFactory::TransparentHeaders = true; // default
bool b2b_connectFactory::TransparentDestination = false; // default
EXPORT_SESSION_FACTORY(b2b_connectFactory,MOD_NAME);
@ -55,6 +56,9 @@ int b2b_connectFactory::onLoad()
if (cfg.getParameter("transparent_headers")=="false")
TransparentHeaders = false;
if (cfg.getParameter("transparent_ruri")=="true")
TransparentDestination = true;
// user_timer_fact = AmPlugIn::instance()->getFactory4Di("user_timer");
// if(!user_timer_fact) {
@ -105,6 +109,7 @@ void b2b_connectDialog::onInvite(const AmSipRequest& req)
}
string app_param = getHeader(req.hdrs, PARAM_HDR);
string remote_party, remote_uri;
if (!app_param.length()) {
throw AmSession::Exception(500, "b2b_connect: parameters not found");
@ -115,8 +120,13 @@ void b2b_connectDialog::onInvite(const AmSipRequest& req)
password = get_header_keyvalue(app_param,"p");
from = "sip:"+user+"@"+domain;
to = "sip:"+req.user+"@"+domain;
if (b2b_connectFactory::TransparentDestination) {
remote_uri = req.r_uri;
remote_party = to = req.to;
} else {
remote_uri = to = "sip:"+req.user+"@"+domain;
remote_party = "<" + to + ">";
}
if(dlg.reply(req, 100, "Connecting") != 0) {
throw AmSession::Exception(500,"Failed to reply 100");
}
@ -132,7 +142,7 @@ void b2b_connectDialog::onInvite(const AmSipRequest& req)
dlg.updateStatus(req);
recvd_req.insert(std::make_pair(req.cseq,req));
connectCallee("<" + to + ">", to, from, from,
connectCallee(remote_party, remote_uri, from, from,
b2b_connectFactory::TransparentHeaders ? invite_req.hdrs : "");
MONITORING_LOG(other_id.c_str(),

@ -46,6 +46,7 @@ class b2b_connectFactory: public AmSessionFactory
AmSession* onInvite(const AmSipRequest& req);
static bool TransparentHeaders; // default
static bool TransparentDestination; // default
};

@ -5,3 +5,10 @@
#
# default:
# transparent_headers = true
# transparent_destination = [true|false]
#
# relay Request URI and To URI from initial INVITE into callee leg?
#
# default:
# transparent_destination = false

Loading…
Cancel
Save