G'Day,
When attempting to build a very simple startup task that connects to a transfer to ACD Queue block and then exit I am confronted with a validation issue that the failureTransferAudio has not been set!
My investigations have failed me discovering any viable path to actually set that option to a valid ToAudioTTS string?
The documentation declares that the addActionTransferToAcd.failureTransferAudio member is read only and the addActionTransferToAcd parameter list excludes any failureTransferAudioTTSopt...?
Please see below the validation summary that stops publishing:
Please find below the example code to produce a basic transfer to ACD Queue task.
const architectScripting = require('purecloud-flow-scripting-api-sdk-javascript'),
clientId = '<<insert clientId here>>',
clientSecret = '<<insert clientSecret here>>',
authToken = '<<insert authorized token here>>',
flowName = 'Test addActionTransferToAcd',
flowDescription = 'Create a startup task that transfers to ACD Queue',
scriptingActionFactory = architectScripting.factories.archFactoryActions, // Factory to create actions
scriptingEnums = architectScripting.enums.archEnums, // Enum support
scriptingFlowFactory = architectScripting.factories.archFactoryFlows, // Factory to create flows
scriptingLanguages = architectScripting.languages.archLanguages, // Language support
scriptingSession = architectScripting.environment.archSession, // Session support
scriptingTaskFactory = architectScripting.factories.archFactoryTasks, // Factory to create tasks
scriptingLogger = architectScripting.services.archLogging, // Logging support
//scriptingVoices = architectScripting.viewModels.textToSpeech,
location = scriptingEnums.LOCATIONS.prod_us_east_1;
scriptingLogger.logNotesVerbose = true;
const main = (scriptSession) => {
scriptingLogger.logNote('#########################EXECUTE MAIN#########################');
return scriptingFlowFactory.createFlowInboundCallAsync(flowName, flowDescription, scriptingLanguages.englishAustralia, (archInboundCallFlow) => {
archInboundCallFlow.initialAudio.setDefaultCaseExpression('ToAudioTTS("Welcome and thank you for calling.")');
archInboundCallFlow.settingsSpeechRec.asrCompanyDir = scriptingEnums.SPEECH_REC_COMPANY_MODES.none;
archInboundCallFlow.settingsSpeechRec.asrEnabledOnFlow = false;
let startupTask = scriptingTaskFactory.addTask(archInboundCallFlow, 'startup task', true),
AcdQueue = scriptingActionFactory.addActionTransferToAcd(startupTask,'Target ACD Queue','Your call may be recorded for coaching or quality purposes');
/* Documentation => node_modules/purecloud-flow-scripting-api-sdk-javascript/src/scripting/documentation/ArchFactoryActions.html#addActionTransferToAcd
* addActionTransferToAcd(archMultiActionContainer, nameopt, preTransferAudioTTSopt, previousArchActionopt) <------ No parameter to set the failureTransferAudioTTSopt
* It appears that the AcdQueue.failureTransferAudio is read only and you cannot traverse the base object to set the value
* readonly failureTransferAudio :ArchAudio
* The failure transfer audio to play on the call in the even the transfer fails at runtime.
* Inherited From:
* ArchBaseActionTransfer#failureTransferAudio
*/
AcdQueue.useDefaultInQueueHandling();
AcdQueue.setLiteralByQueueNameAsync('Cyara Test');
scriptingActionFactory.addActionDisconnect(startupTask, 'end of task disconnect');
return archInboundCallFlow.validateAsync()
.then((validationResults) => {
if (validationResults.hasErrors) {
scriptingLogger.logError('There is at least one validation error in the created flow. Not publishing.');
}
else if (validationResults.hasWarnings) {
scriptingLogger.logWarning('There is at least one validation warning in the created flow. Not publishing.');
}
else {
scriptingLogger.logNote('The flow has no validation errors or warnings. Time to publish it.');
return archInboundCallFlow.publishAsync()
.then(() => {
scriptingLogger.logNote();
scriptingLogger.logNote('****************************************************************************');
scriptingLogger.logNote('The flow \'' + archInboundCallFlow.name + '\' is now published in and available in Architect.');
scriptingLogger.logNote('Flow URL: ' + archInboundCallFlow.url);
scriptingLogger.logNote('****************************************************************************');
scriptingLogger.logNote();
}
);
}
}
);
});
}
scriptingSession.startWithAuthToken(location, main, authToken);
//scriptingSession.startWithClientIdAndSecret(location, main, clientId, clientSecret);
Cheers,
Bundy