diff --git a/lib/call-session.js b/lib/call-session.js index c968152..1ec3530 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -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'),