update deps, only subscribe for DTMF when client is possibly webrtc

This commit is contained in:
Dave Horton
2022-11-06 10:12:18 -05:00
parent 7fb9966d20
commit b072524585
3 changed files with 30 additions and 11 deletions

View File

@@ -84,6 +84,10 @@ class CallSession extends Emitter {
return this.req.has('X-Five9-StreamingPairId');
}
get isPossibleWebRtcClient() {
return this.req.locals.isPossibleWebRtcClient;
}
subscribeForDTMF(dlg) {
if (!this._subscribedForDTMF) {
this._subscribedForDTMF = true;
@@ -147,7 +151,8 @@ class CallSession extends Emitter {
}
this.logger.debug(`using feature server ${featureServer}`);
this.rtpEngineOpts = makeRtpEngineOpts(this.req, SdpWantsSrtp(sdp), false, this.isFromMSTeams);
const wantsSrtp = this.req.locals.possibleWebRtcClient = SdpWantsSrtp(sdp);
this.rtpEngineOpts = makeRtpEngineOpts(this.req, wantsSrtp, false, this.isFromMSTeams);
this.rtpEngineResource = {destroy: this.del.bind(null, this.rtpEngineOpts.common)};
const obj = parseUri(this.req.uri);
let proxy, host, uri;
@@ -304,7 +309,7 @@ class CallSession extends Emitter {
_setDlgHandlers(dlg) {
const {callId} = dlg.sip;
this.activeCallIds.set(callId, this);
this.subscribeForDTMF(dlg);
if (this.isPossibleWebRtcClient) this.subscribeForDTMF(dlg);
dlg.on('destroy', () => {
debug('call ended with normal termination');
this.logger.info('call ended with normal termination');
@@ -409,7 +414,7 @@ class CallSession extends Emitter {
});
});
this.subscribeForDTMF(uac);
if (this.isPossibleWebRtcClient) this.subscribeForDTMF(uac);
uas.on('modify', this._onReinvite.bind(this, uas));
uac.on('modify', this._onReinvite.bind(this, uac));

28
package-lock.json generated
View File

@@ -12,7 +12,7 @@
"@jambonz/db-helpers": "^0.7.3",
"@jambonz/http-authenticator": "^0.2.2",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.4.35",
"@jambonz/realtimedb-helpers": "^0.5.7",
"@jambonz/rtpengine-utils": "^0.3.11",
"@jambonz/siprec-client-utils": "^0.1.4",
"@jambonz/stats-collector": "^0.1.6",
@@ -618,16 +618,18 @@
}
},
"node_modules/@jambonz/realtimedb-helpers": {
"version": "0.4.35",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.4.35.tgz",
"integrity": "sha512-lfNTlWRnLbOKVRDto1nUgOmr2jlmOHxslg+Zs9dSB8eEEkIqCNZn9f5kxxXThVpRSrCtsgGsX/w1wXygGiTn5w==",
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.5.7.tgz",
"integrity": "sha512-TOTnFWSa4ronCdQTWfB8c5VI6DXcBEyDA4vbZnzkVAzSP90NpRPOPrvo2tEZxcGSlVIjBZew7rWgWyqkSwUT/Q==",
"dependencies": {
"@google-cloud/text-to-speech": "^4.0.3",
"@grpc/grpc-js": "^1.7.3",
"@jambonz/promisify-redis": "^0.0.6",
"aws-sdk": "^2.1238.0",
"bent": "^7.3.12",
"debug": "^4.3.3",
"form-urlencoded": "^6.1.0",
"google-protobuf": "^3.21.2",
"microsoft-cognitiveservices-speech-sdk": "^1.24.0",
"redis": "^3.1.2",
"undici": "^5.11.0"
@@ -2671,6 +2673,11 @@
"node": ">=12.0.0"
}
},
"node_modules/google-protobuf": {
"version": "3.21.2",
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz",
"integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA=="
},
"node_modules/graceful-fs": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
@@ -6243,16 +6250,18 @@
}
},
"@jambonz/realtimedb-helpers": {
"version": "0.4.35",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.4.35.tgz",
"integrity": "sha512-lfNTlWRnLbOKVRDto1nUgOmr2jlmOHxslg+Zs9dSB8eEEkIqCNZn9f5kxxXThVpRSrCtsgGsX/w1wXygGiTn5w==",
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.5.7.tgz",
"integrity": "sha512-TOTnFWSa4ronCdQTWfB8c5VI6DXcBEyDA4vbZnzkVAzSP90NpRPOPrvo2tEZxcGSlVIjBZew7rWgWyqkSwUT/Q==",
"requires": {
"@google-cloud/text-to-speech": "^4.0.3",
"@grpc/grpc-js": "^1.7.3",
"@jambonz/promisify-redis": "^0.0.6",
"aws-sdk": "^2.1238.0",
"bent": "^7.3.12",
"debug": "^4.3.3",
"form-urlencoded": "^6.1.0",
"google-protobuf": "^3.21.2",
"microsoft-cognitiveservices-speech-sdk": "^1.24.0",
"redis": "^3.1.2",
"undici": "^5.11.0"
@@ -7834,6 +7843,11 @@
"node-forge": "^1.3.1"
}
},
"google-protobuf": {
"version": "3.21.2",
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz",
"integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA=="
},
"graceful-fs": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",

View File

@@ -26,7 +26,7 @@
},
"dependencies": {
"@jambonz/db-helpers": "^0.7.3",
"@jambonz/realtimedb-helpers": "^0.4.35",
"@jambonz/realtimedb-helpers": "^0.5.7",
"@jambonz/http-authenticator": "^0.2.2",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/rtpengine-utils": "^0.3.11",