This commit is contained in:
Dave Horton
2020-02-19 14:44:13 -05:00
parent ea217be9fa
commit 504b08bb12
2 changed files with 4 additions and 7 deletions
+1 -2
View File
@@ -80,7 +80,7 @@ class CallSession extends Emitter {
while (uris.length) {
const uri = uris.shift();
debug(`sending INVITE to ${uri} via ${proxy})`);
this.logger.info(`sending INVITE to ${uri} via ${proxy})`);
this.logger.info(`sending INVITE to ${uri}`);
try {
const {uas, uac} = await this.srf.createB2BUA(this.req, this.res, uri, {
proxy,
@@ -130,7 +130,6 @@ class CallSession extends Emitter {
break;
}
else {
debug(`got ${err.status}, cranking back to next destination`);
this.logger.info(`got ${err.status}, cranking back to next destination`);
}
}
+3 -5
View File
@@ -44,18 +44,17 @@ function route(opts) {
if (!dotDecimalHost) {
// uri host is not a dot-decimal address, so try to look up user
logger.debug(`searching for registered user ${aor}`);
debug(`searching for registered user ${aor}`);
reg = await registrar.query(aor);
if (reg) {
// user is registered..find out which sbc is handling it
// us => we can put the call through
// other sbc => proxy the call there
logger.debug(`found registered user ${JSON.stringify(reg)}`);
logger.info({req}, 'sending call to registered user');
if (req.server.hostport !== reg.sbcAddress) {
//proxy
const proxyAddress = selectHostPort(reg.sbcAddress, 'udp');
logger.info(`proxying call to SBC at ${proxyAddress}`);
logger.debug(`proxying call to SBC at ${proxyAddress}`);
req.proxy(`sip:${proxyAddress[1]}`);
return;
}
@@ -67,7 +66,7 @@ function route(opts) {
else if (!isLocalUri(uri.host, req) /*|| !dotDecimalHost */) {
// TODO: need to try to forward calls to a DNS host name
// so long as that domain name is not associated with an account or SP in our DB
logger.info(`forwarding call to ${req.uri}`);
logger.info(`forwarding call to sip endpoint ${req.uri}`);
req.locals.target = 'forward';
return next();
}
@@ -81,7 +80,6 @@ function route(opts) {
return res.send(404);
}
logger.info('sending call to LCR');
debug('sending call to LCR');
req.locals.target = 'lcr';
next();