mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
bugfix #30 - outdial race condition for quick caller cancel scenario
This commit is contained in:
@@ -114,6 +114,17 @@ class SingleDialer extends Emitter {
|
|||||||
|
|
||||||
this.ep = await ms.createEndpoint();
|
this.ep = await ms.createEndpoint();
|
||||||
this.logger.debug(`SingleDialer:exec - created endpoint ${this.ep.uuid}`);
|
this.logger.debug(`SingleDialer:exec - created endpoint ${this.ep.uuid}`);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* were we killed whilst we were off getting an endpoint ?
|
||||||
|
* https://github.com/jambonz/jambonz-feature-server/issues/30
|
||||||
|
*/
|
||||||
|
if (this.killed) {
|
||||||
|
this.logger.info('SingleDialer:exec got quick CANCEL from caller, abort outdial');
|
||||||
|
this.ep.destroy()
|
||||||
|
.catch((err) => this.logger.error({err}, 'Error destroying endpoint'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
let lastSdp;
|
let lastSdp;
|
||||||
const connectStream = async(remoteSdp) => {
|
const connectStream = async(remoteSdp) => {
|
||||||
if (remoteSdp === lastSdp) return;
|
if (remoteSdp === lastSdp) return;
|
||||||
@@ -215,6 +226,7 @@ class SingleDialer extends Emitter {
|
|||||||
* kill the call in progress or the stable dialog, whichever we have
|
* kill the call in progress or the stable dialog, whichever we have
|
||||||
*/
|
*/
|
||||||
async kill() {
|
async kill() {
|
||||||
|
this.killed = true;
|
||||||
if (this.inviteInProgress) await this.inviteInProgress.cancel();
|
if (this.inviteInProgress) await this.inviteInProgress.cancel();
|
||||||
else if (this.dlg && this.dlg.connected) {
|
else if (this.dlg && this.dlg.connected) {
|
||||||
const duration = moment().diff(this.dlg.connectTime, 'seconds');
|
const duration = moment().diff(this.dlg.connectTime, 'seconds');
|
||||||
|
|||||||
1359
package-lock.json
generated
1359
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jambonz-feature-server",
|
"name": "jambonz-feature-server",
|
||||||
"version": "0.2.4",
|
"version": "0.2.5",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10.16.0"
|
"node": ">= 10.16.0"
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
"@jambonz/db-helpers": "^0.4.2",
|
"@jambonz/db-helpers": "^0.4.2",
|
||||||
"@jambonz/realtimedb-helpers": "^0.2.16",
|
"@jambonz/realtimedb-helpers": "^0.2.16",
|
||||||
"@jambonz/stats-collector": "^0.0.4",
|
"@jambonz/stats-collector": "^0.0.4",
|
||||||
|
"aws-sdk": "^2.830.0",
|
||||||
"bent": "^7.3.9",
|
"bent": "^7.3.9",
|
||||||
"cidr-matcher": "^2.1.1",
|
"cidr-matcher": "^2.1.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
"moment": "^2.27.0",
|
"moment": "^2.27.0",
|
||||||
"parse-url": "^5.0.2",
|
"parse-url": "^5.0.2",
|
||||||
"pino": "^6.5.1",
|
"pino": "^6.5.1",
|
||||||
|
"uuid": "^3.4.0",
|
||||||
"verify-aws-sns-signature": "^0.0.6",
|
"verify-aws-sns-signature": "^0.0.6",
|
||||||
"xml2js": "^0.4.23"
|
"xml2js": "^0.4.23"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const test = require('tape').test ;
|
const test = require('blue-tape') ;
|
||||||
const exec = require('child_process').exec ;
|
const exec = require('child_process').exec ;
|
||||||
const pwd = process.env.TRAVIS ? '' : '-p$MYSQL_ROOT_PASSWORD';
|
const pwd = process.env.TRAVIS ? '' : '-p$MYSQL_ROOT_PASSWORD';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
const test = require('tape').test ;
|
const test = require('blue-tape') ;
|
||||||
const exec = require('child_process').exec ;
|
const exec = require('child_process').exec ;
|
||||||
const async = require('async');
|
|
||||||
|
|
||||||
test('starting docker network..', (t) => {
|
test('starting docker network..', (t) => {
|
||||||
exec(`docker-compose -f ${__dirname}/docker-compose-testbed.yaml up -d`, (err, stdout, stderr) => {
|
exec(`docker-compose -f ${__dirname}/docker-compose-testbed.yaml up -d`, (err, stdout, stderr) => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const test = require('tape').test ;
|
const test = require('blue-tape') ;
|
||||||
const exec = require('child_process').exec ;
|
const exec = require('child_process').exec ;
|
||||||
|
|
||||||
test('stopping docker network..', (t) => {
|
test('stopping docker network..', (t) => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const test = require('tape').test ;
|
const test = require('blue-tape') ;
|
||||||
const exec = require('child_process').exec ;
|
const exec = require('child_process').exec ;
|
||||||
const pwd = process.env.TRAVIS ? '' : '-p$MYSQL_ROOT_PASSWORD';
|
const pwd = process.env.TRAVIS ? '' : '-p$MYSQL_ROOT_PASSWORD';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const test = require('tape');
|
const test = require('blue-tape');
|
||||||
const debug = require('debug')('drachtio:jambonz:test');
|
const debug = require('debug')('drachtio:jambonz:test');
|
||||||
const makeTask = require('../lib/tasks/make_task');
|
const makeTask = require('../lib/tasks/make_task');
|
||||||
const noop = () => {};
|
const noop = () => {};
|
||||||
|
|||||||
Reference in New Issue
Block a user