mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
metrics
This commit is contained in:
@@ -172,6 +172,29 @@ class CallSession extends Emitter {
|
||||
sessionTracker.remove(this.callSid);
|
||||
}
|
||||
|
||||
normalizeUrl(url, method, auth) {
|
||||
const hook = {
|
||||
url,
|
||||
method
|
||||
};
|
||||
if (auth && auth.username && auth.password) {
|
||||
hook.auth = {
|
||||
username: auth.username,
|
||||
password: auth.password
|
||||
};
|
||||
}
|
||||
if (typeof url === 'string' && url.startsWith('/')) {
|
||||
const baseUrl = this.requestor.baseUrl;
|
||||
hook.url = `${baseUrl}${url}`;
|
||||
if (this.requestor.username && this.requestor.password) {
|
||||
hook.auth = {
|
||||
username: this.requestor.username,
|
||||
password: this.requestor.password
|
||||
};
|
||||
}
|
||||
}
|
||||
return hook;
|
||||
}
|
||||
/**
|
||||
* This is called when all tasks have completed. It is not implemented in the superclass
|
||||
* but provided as a convenience for subclasses that need to do cleanup at the end of
|
||||
@@ -536,7 +559,8 @@ class CallSession extends Emitter {
|
||||
|
||||
// update calls db
|
||||
this.logger.debug(`updating redis with ${JSON.stringify(this.callInfo)}`);
|
||||
this.updateCallStatus(this.callInfo, this.serviceUrl).catch((err) => this.logger.error(err, 'redis error'));
|
||||
this.updateCallStatus(Object.assign({}, this.callInfo), this.serviceUrl)
|
||||
.catch((err) => this.logger.error(err, 'redis error'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user