Skip to content

Commit

Permalink
listen on B endpoint if nested listen in dial has channel === 2
Browse files Browse the repository at this point in the history
  • Loading branch information
davehorton committed Jan 16, 2025
1 parent 9aaa77a commit f20030f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions lib/tasks/dial.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ class TaskDial extends Task {
}
}

if (this.data.listen) {
this.listenTask = makeTask(logger, {'listen': this.data.listen}, this);
const listenData = this.data.listen || this.data.stream;
if (listenData) {
this.listenTask = makeTask(logger, {'listen': listenData }, this);
}
if (this.data.transcribe) {
this.transcribeTask = makeTask(logger, {'transcribe' : this.data.transcribe}, this);
Expand Down Expand Up @@ -873,7 +874,7 @@ class TaskDial extends Task {
if (cs.sipRequestWithinDialogHook) this._initSipIndialogRequestListener(cs, this.dlg);

if (this.transcribeTask) this.transcribeTask.exec(cs, {ep: this.epOther, ep2:this.ep});
if (this.listenTask) this.listenTask.exec(cs, {ep: this.epOther});
if (this.listenTask) this.listenTask.exec(cs, {ep: this.listenTask.channel === 2 ? this.ep : this.epOther});
if (this.startAmd) {
try {
this.startAmd(cs, this.ep, this, this.data.amd);
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TaskListen extends Task {

[
'action', 'auth', 'method', 'url', 'finishOnKey', 'maxLength', 'metadata', 'mixType', 'passDtmf', 'playBeep',
'sampleRate', 'timeout', 'transcribe', 'wsAuth', 'disableBidirectionalAudio'
'sampleRate', 'timeout', 'transcribe', 'wsAuth', 'disableBidirectionalAudio', 'channel'
].forEach((k) => this[k] = this.data[k]);

this.mixType = this.mixType || 'mono';
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@jambonz/realtimedb-helpers": "^0.8.8",
"@jambonz/speech-utils": "^0.2.1",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/verb-specifications": "^0.0.93",
"@jambonz/verb-specifications": "^0.0.94",
"@jambonz/time-series": "^0.2.13",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/exporter-jaeger": "^1.23.0",
Expand Down

0 comments on commit f20030f

Please sign in to comment.