mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-07-04 19:32:01 +00:00
on dial do not reinvite A leg on answer if already answered and we are anchoring media (#1508)
This commit is contained in:
+9
-2
@@ -195,6 +195,9 @@ class TaskDial extends Task {
|
|||||||
async exec(cs) {
|
async exec(cs) {
|
||||||
await super.exec(cs);
|
await super.exec(cs);
|
||||||
|
|
||||||
|
/* capture whether A leg was already answered before this dial task started */
|
||||||
|
this._aLegAlreadyAnswered = !!cs.dlg;
|
||||||
|
|
||||||
if (this.data.anchorMedia && this.data.exitMediaPath) {
|
if (this.data.anchorMedia && this.data.exitMediaPath) {
|
||||||
this.logger.info('Dial:exec - incompatible anchorMedia and exitMediaPath are both set, will obey anchorMedia');
|
this.logger.info('Dial:exec - incompatible anchorMedia and exitMediaPath are both set, will obey anchorMedia');
|
||||||
delete this.data.exitMediaPath;
|
delete this.data.exitMediaPath;
|
||||||
@@ -872,8 +875,12 @@ class TaskDial extends Task {
|
|||||||
this.sd = sd;
|
this.sd = sd;
|
||||||
this.callSid = sd.callSid;
|
this.callSid = sd.callSid;
|
||||||
if (this.earlyMedia) {
|
if (this.earlyMedia) {
|
||||||
debug('Dial:_selectSingleDial propagating answer supervision on A leg now that B is connected');
|
if (this._aLegAlreadyAnswered) {
|
||||||
await cs.propagateAnswer();
|
debug('Dial:_selectSingleDial A leg was already answered, skipping propagateAnswer');
|
||||||
|
} else {
|
||||||
|
debug('Dial:_selectSingleDial propagating answer supervision on A leg now that B is connected');
|
||||||
|
await cs.propagateAnswer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.timeLimit) {
|
if (this.timeLimit) {
|
||||||
this.timerMaxCallDuration = setTimeout(this._onMaxCallDuration.bind(this, cs), this.timeLimit * 1000);
|
this.timerMaxCallDuration = setTimeout(this._onMaxCallDuration.bind(this, cs), this.timeLimit * 1000);
|
||||||
|
|||||||
Reference in New Issue
Block a user