add support for live call control

This commit is contained in:
Dave Horton
2020-02-07 10:26:35 -05:00
parent 2811e35c6b
commit 3ca2d982cc
18 changed files with 332 additions and 73 deletions

View File

@@ -56,10 +56,10 @@ class TaskDial extends Task {
this.confirmMethod = this.data.confirmMethod;
if (this.data.listen) {
this.listenTask = makeTask(logger, {'listen': this.data.listen});
this.listenTask = makeTask(logger, {'listen': this.data.listen}, this);
}
if (this.data.transcribe) {
this.transcribeTask = makeTask(logger, {'transcribe' : this.data.transcribe});
this.transcribeTask = makeTask(logger, {'transcribe' : this.data.transcribe}, this);
}
this.results = {};
@@ -131,7 +131,7 @@ class TaskDial extends Task {
const sbcAddress = cs.direction === CallDirection.Inbound ?
`${req.source_address}:${req.source_port}` :
config.get('sbcAddress');
config.get('outdials.sbc');
const opts = {
headers: req && req.has('X-CID') ? Object.assign(this.headers, {'X-CID': req.get('X-CID')}) : this.headers,
proxy: `sip:${sbcAddress}`,
@@ -268,8 +268,8 @@ class TaskDial extends Task {
dialCallSid: sd.callSid,
});
if (this.transcribeTask) this.transcribeTask.exec(cs, this.ep, this);
if (this.listenTask) this.listenTask.exec(cs, this.ep, this);
if (this.transcribeTask) this.transcribeTask.exec(cs, this.ep);
if (this.listenTask) this.listenTask.exec(cs, this.ep);
}
_bridgeEarlyMedia(sd) {