fixes for confirm session (#663)

* fixes for confirm session

* allow empty dialconfirm array
This commit is contained in:
Dave Horton
2024-02-22 12:33:35 -05:00
committed by GitHub
parent 1b5f801830
commit fc3655c9bd
3 changed files with 17 additions and 1 deletions

View File

@@ -7,7 +7,8 @@ const {
TaskName,
KillReason,
RecordState,
AllowedSipRecVerbs
AllowedSipRecVerbs,
AllowedConfirmSessionVerbs
} = require('../utils/constants');
const moment = require('moment');
const assert = require('assert');
@@ -1420,6 +1421,19 @@ Duration=${duration} `
tasks = pruned;
}
}
else if (this.isConfirmCallSession) {
const pruned = tasks.filter((t) => AllowedConfirmSessionVerbs.includes(t.name));
if (0 === pruned.length) {
this.logger.info({tasks},
'CallSession:replaceApplication - filtering verbs allowed on an confirmSession call');
return;
}
if (pruned.length < tasks.length) {
this.logger.info(
'CallSession:replaceApplication - removing verbs that are not allowed for confirmSession call');
tasks = pruned;
}
}
this.tasks = tasks;
this.taskIdx = 0;
this.stackIdx++;