block media going back to Five9 voicestream

This commit is contained in:
Dave Horton
2022-10-20 23:05:34 -04:00
parent c4d07b517e
commit dbedd7419e
+11
View File
@@ -80,6 +80,10 @@ class CallSession extends Emitter {
return tp && -1 !== tp.indexOf('SAVP');
}
get isFive9VoiceStream() {
return this.req.has('X-Five9-StreamingPairId');
}
async connect() {
const {sdp} = this.req.locals;
this.logger.info('inbound call accepted for routing');
@@ -168,6 +172,13 @@ class CallSession extends Emitter {
throw new Error('rtpengine failed: answer');
}
/* special case: Five9 Voicestream calls do not advertise a:sendonly, though they should */
if (this.isFive9VoiceStream) {
this.logger.info('Voicestream call from Five9, blocking audio in the reverse direction');
const response = Promise.all([this.blockMedia(opts), this.blockDTMF(opts)]);
this.logger.debug({response}, 'response to blocMedia');
}
let headers = {
'From': createBLegFromHeader(this.req),
'To': this.req.get('To'),