diff --git a/lib/utils/place-outdial.js b/lib/utils/place-outdial.js index 5afc9c7f..885ca58d 100644 --- a/lib/utils/place-outdial.js +++ b/lib/utils/place-outdial.js @@ -108,11 +108,11 @@ class SingleDialer extends Emitter { this.ep = await ms.createEndpoint(); this.logger.debug(`SingleDialer:exec - created endpoint ${this.ep.uuid}`); - let promiseStreamConnected; + let lastSdp; const connectStream = async(remoteSdp) => { - // wait for previous re-invite to complete, if any - if (promiseStreamConnected) await promiseStreamConnected.catch((err) => {}); - return promiseStreamConnected = this.ep.modify(remoteSdp); + if (remoteSdp === lastSdp) return; + lastSdp = remoteSdp; + return this.ep.modify(remoteSdp); }; Object.assign(opts, { @@ -161,9 +161,9 @@ class SingleDialer extends Emitter { this.emit('callStatusChange', status); } }); - await connectStream(this.dlg.remote.sdp); - this.dlg.callSid = this.callSid; this.inviteInProgress = null; + this.dlg.callSid = this.callSid; + await connectStream(this.dlg.remote.sdp); this.emit('callStatusChange', {sipStatus: 200, callStatus: CallStatus.InProgress}); this.logger.debug(`SingleDialer:exec call connected: ${this.callSid}`); const connectTime = this.dlg.connectTime = moment(); diff --git a/package-lock.json b/package-lock.json index 4970aa8a..76f9c093 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1164,9 +1164,9 @@ "integrity": "sha1-Bmlv43Wvt/68AI8oaCJWukEHWAE=" }, "drachtio-sip": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/drachtio-sip/-/drachtio-sip-0.4.0.tgz", - "integrity": "sha512-/HHK0KH8sfQxUuVrYwaaRxdCq7j6sAQMxzegqzGQeOULx2TNeYb9Bf2SF5AO59DpmYkQRc+ezuHX58EpN/SR7A==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/drachtio-sip/-/drachtio-sip-0.4.1.tgz", + "integrity": "sha512-XjrsVb4O5bjgAr/hWogFk8TLoSp2bbOKYhFAFRayiMs/w7PkYep5z5IOW+erbR8LgVDjZVfdGxjA0RPkI4QMvA==", "requires": { "debug": "^4.1.1", "merge": ">=1.2.1", @@ -1176,16 +1176,16 @@ } }, "drachtio-srf": { - "version": "4.4.37", - "resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-4.4.37.tgz", - "integrity": "sha512-Z7MpHzee8z6gYVFgLRCqTC2Tt7d0v+EjDLhpZDLpEX0gMTs2Qey+VZ6QxO4CGyMrysZsLBZG5ZBNEifC2gBkHg==", + "version": "4.4.39", + "resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-4.4.39.tgz", + "integrity": "sha512-wqiCe3nM8C9OJwllYVTMoYpVIjtWgX1TcyYy4y0b8jII9uhyB6CaK8aRfgzesZLJ6NTVlioS3a2Ic3e3Cmrkng==", "requires": { "async": "^1.4.2", "debug": "^3.2.6", "delegates": "^0.1.0", "deprecate": "^1.1.1", "drachtio-mw-registration-parser": "0.0.2", - "drachtio-sip": "^0.4.0", + "drachtio-sip": "^0.4.1", "lodash": "^4.17.20", "node-noop": "0.0.1", "only": "0.0.2", diff --git a/package.json b/package.json index 2b43c997..66a62db9 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "debug": "^4.1.1", "deepcopy": "^2.1.0", "drachtio-fsmrf": "^2.0.1", - "drachtio-srf": "^4.4.37", + "drachtio-srf": "^4.4.39", "express": "^4.17.1", "ip": "^1.1.5", "jambonz-mw-registrar": "^0.1.3",