mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-07-04 19:11:47 +00:00
block media going back to Five9 voicestream
This commit is contained in:
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user