mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-13 17:59:42 +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:
@@ -195,6 +195,9 @@ class TaskDial extends Task {
|
||||
async 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) {
|
||||
this.logger.info('Dial:exec - incompatible anchorMedia and exitMediaPath are both set, will obey anchorMedia');
|
||||
delete this.data.exitMediaPath;
|
||||
@@ -872,8 +875,12 @@ class TaskDial extends Task {
|
||||
this.sd = sd;
|
||||
this.callSid = sd.callSid;
|
||||
if (this.earlyMedia) {
|
||||
debug('Dial:_selectSingleDial propagating answer supervision on A leg now that B is connected');
|
||||
await cs.propagateAnswer();
|
||||
if (this._aLegAlreadyAnswered) {
|
||||
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) {
|
||||
this.timerMaxCallDuration = setTimeout(this._onMaxCallDuration.bind(this, cs), this.timeLimit * 1000);
|
||||
|
||||
Reference in New Issue
Block a user