mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-10-09 21:14:05 +00:00
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:
+2
-1
@@ -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
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user