Bundy | 2019-05-15 09:26:55 UTC | #1
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.produseast1; 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.SPEECHRECCOMPANYMODES.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 :metal:
MelissaBailey | 2019-05-15 13:56:40 UTC | #2
AcdQueue.failureTransferAudio.setDefaultCaseLiteralTTS("something to say");
FYI no failure audio is a warning, not an error. It's only preventing the publish b/c you told it to, if you take out the else if case you will be able to publish.
Bundy | 2019-05-15 21:07:28 UTC | #3
:clap: Bravo @MelissaBailey thank you.
I feel it is better to keep as much validation switched on when attempting something for the first time! :wink: One could only imagine what could be published at the mercy of my clumsy computing! :stuckouttonguewinkingeye:
Cheers,
Bundy :metal:
system | 2019-06-15 21:14:09 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 5153