Feature/rtpengine locate by dns (#28)

* k8s: query dns for rtpengine endpoints

* use udp now in k8s

* catch error on rtpengine failure
This commit is contained in:
Dave Horton
2022-01-23 17:32:51 -05:00
committed by GitHub
parent 2ca44c4f5a
commit fc7cdae22a
3 changed files with 53 additions and 24 deletions
+2 -1
View File
@@ -372,7 +372,8 @@ class CallSession extends Emitter {
debug(`got final outdial error: ${err}`);
if (!passFailure) this.res.send(status);
this.emit('failed');
this.rtpEngineResource.destroy();
this.rtpEngineResource.destroy()
.catch((err) => this.logger.info({err}, 'Error destroying rtpe after failure'));
const tags = ['accepted:no', `sipStatus:${status}`];
this.stats.increment('sbc.originations', tags);
+13 -1
View File
@@ -73,9 +73,21 @@ const pingMsTeamsGateways = (logger, srf) => {
const makeCallCountKey = (sid) => `${sid}:outcalls`;
const equalsIgnoreOrder = (a, b) => {
if (a.length !== b.length) return false;
const uniqueValues = new Set([...a, ...b]);
for (const v of uniqueValues) {
const aCount = a.filter((e) => e === v).length;
const bCount = b.filter((e) => e === v).length;
if (aCount !== bCount) return false;
}
return true;
};
module.exports = {
makeRtpEngineOpts,
selectHostPort,
pingMsTeamsGateways,
makeCallCountKey
makeCallCountKey,
equalsIgnoreOrder
};