mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-10-04 02:04:19 +00:00
logging
This commit is contained in:
+1
-2
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user