ArchActionTransferToVoicemail(coreTransferToVoiceMailViewModel)

new ArchActionTransferToVoicemail(coreTransferToVoiceMailViewModel)

The Architect Scripting class for the Transfer to User action. Instances of this action should be created by calling ArchFactoryActions#addActionTransferToVoicemail In order to work with this action, the easiest thing is to do is set the transfer target type to the desired mode before attempting to set settings on the action as it will enable / disable the properties that can be set appropriately. See the transfer target type property on how to configure this action to transfer to a user's voicemail or a queue's voicemail.

Parameters:
Name Type Description
coreTransferToVoiceMailViewModel TransferVoicemailAction

( Internal ) an Architect core transfer to user action view model.

See:

Extends

Members

static, readonly displayTypeName :string

Returns the display type name string 'ArchActionTransferToVoicemail'.

static, readonly isArchActionTransferToVoicemail :boolean

Returns true indicating that this is an ArchActionTransferToVoicemail instance.

readonly callbackNumber :ArchValuePhoneNumber

The suggested phone number to use for the voicemail callback. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'queue' Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

readonly calleeName :ArchValueString

The suggested phone number to use for the voicemail callback. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'queue' Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

readonly displayTypeNameArchitect :string

The Architect action type label

Inherited From:

readonly failureOutputs :ArchNamedValueList

List of properties with error information about failed transfers

Inherited From:

readonly failureTransferAudio :ArchAudio

The failure transfer audio to play on the call in the even the transfer fails at runtime.

Inherited From:

readonly hasFakeSuccessOutput :boolean

Returns true indicating that this action has a fake success output.

Inherited From:

readonly id :string

The identifier string for this object.

Inherited From:

readonly idMayBeBlank :string

Returns whether or not the id property may be blank or undefined for this object. For example, the returned settings from ArchMenu#settingsMenu will have a blank identifier along with the settings returned from ArchMenu#settingsSpeechRec. Note that this is an extremely rare case.

Inherited From:
See:

readonly isArchBaseCoreObject :boolean

Returns true indicating that this is an ArchBaseCoreObject instance.

Inherited From:

readonly isMenuChoiceAction :boolean

Returns whether or not this action is the action property for a menu choice. For example, the ArchMenuDisconnect#actionDisconnect property on an ArchMenuDisconnect instance.

Inherited From:

readonly isReachable :boolean

Returns whether or not this action is reachable at runtime.

Inherited From:

readonly isSecure :boolean

Returns whether or not this action is secure which means either the action by its very nature is secure or it consumes secure data.

Inherited From:

readonly isUnreachable :boolean

Returns whether or not this action is unreachable at runtime.

Inherited From:

readonly logStr :string

A string suitable for logging that contains information about this action. This will contain the action tracking id, name and scripting type name.

Inherited From:

readonly logStrTypeOnly :string

This is a string suitable for logging information about this object where it's just the object's type. This is normally used when logging errors that occur in constructor parameter checking because the scripting object isn't set up and the normal logging str contents wouldn't be set up.

Inherited From:

name :string

The name of the action

Inherited From:

readonly outputCount :number

Returns the number of outputs on this action. For actions that have a fake success output like what you see on the various transfer actions, that will be included in the count to be consistent with the Architect UI. Attempting to get the output count on a menu choice's action such as such as the ArchMenuTransferToAcd#actionTransferToAcd action on an ArchMenuTransferToAcd menu will return 0.

Inherited From:

readonly outputFailure :ArchActionOutput

The failure output for this action

Inherited From:

readonly outputs :Array.<ArchActionOutput>

Returns an array of action outputs for this action. Remember that it is possible to have an undefined item in the returned ArchActionOutput array. This is true when the output is "fake". Accessing the outputs on a menu choice's action such as ArchMenuTransferToAcd#actionTransferToAcd will return an empty array.

Inherited From:

readonly parentFlow :ArchBaseFlow

Returns the parent flow for this action.

Inherited From:

readonly parentMenuChoice :ArchBaseMenuChoice

Returns the parent menu choice if this action is the action for a menu choice. Otherwise, nothing is returned.

Inherited From:

readonly parentState :ArchState

Returns the parent state that contains this action if this action is in a state. Otherwise, nothing is returned.

Inherited From:

readonly parentTask :ArchTask|ArchTaskLoop

Returns the parent task that contains this action if this action is in a task or looping task. Otherwise, nothing is returned.

Inherited From:

readonly preTransferAudio :ArchAudio

The pre transfer audio to play on the call.

Inherited From:

readonly scriptInputs :ArchNamedValueList

The inputs for the Composer script configured on this action. See ArchActionTransferToVoicemail#setScriptByNameAsync or ArchActionTransferToVoicemail#setScriptByIdAsync to set the script. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'queue' Note: Do not attempt to set a value inputs on the selected script the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

readonly targetGroup :ArchValueQueue

The group whose voicemail you want to transfer to at runtime. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'group' Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

readonly targetQueue :ArchValueQueue

The queue whose voicemail you want to transfer to at runtime. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'queue' Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

readonly targetUser :ArchValueUser

The user whose voicemail you want to transfer to at runtime. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'user' Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

readonly trackingId :number

The integer tracking identifier for this action. This is the numeric identifier is displayed in the Architect user interface.

Inherited From:

transferTargetType :string

The transfer target type on the Transfer to Voicemail action. The string values in ArchEnums#VOICEMAIL_TRANSFER_TARGET_TYPES lists valid transfer target type values. The default setting will be to transfer to a user's voicemail.

readonly voicemailGreeting :ArchAudio

The voicemail audio to play on the call after the pre-transfer audio is played.

  • This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:
  • 'queue' Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

Methods

getOutputById(output) → {ArchActionOutput}

Gets an output by its identifier. If it cannot be found, this method will throw. Normally you won't need to use this method and will use the helper methods available on inheriting classes when accessing pre-defined outputs like success, failure, timeout, etc. etc. Attempting to get an output by id on a menu choice's action such as the ArchMenuTransferToAcd#actionTransferToAcd action on an ArchMenuTransferToAcd menu will return nothing.

Parameters:
Name Type Description
output string | ArchBranch

identifies output you want to obtain. If output is an ArchBranch instance, the ArchBranch#outputId value will be used. Otherwise valid string identifier values can be found in ArchEnums#OUTPUT_IDS or can be a guid. Remember that requesting the 'success' output on an action with a fake success output will return nothing.

Returns:
ArchActionOutput
Inherited From:

getOutputByIndex(index) → {ArchActionOutput}

Returns the output at the given index. It's important to note that on actions that have a fake success output if you request the output at the index for the fake success, you will get nothing returned because the fake success output isn't something that you should do anything with. Attempting to access an output by index on a menu choice's action such as ArchMenuTransferToAcd#actionTransferToAcd will return nothing.

Parameters:
Name Type Description
index number

the index of the output to retrieve. This value should be a non-negative integer.

Returns:
ArchActionOutput
Inherited From:

getOutputByName(output, wantDynamicOutputopt) → {ArchActionOutput}

Gets an output by its identifier. If it cannot be found, this method will throw. Normally you won't need to use this method and will use the helper methods available on inheriting classes when accessing pre-defined outputs like success, failure, timeout, etc. etc. Attempting to get an output by id on a menu choice's action such as the ArchMenuTransferToAcd#actionTransferToAcd action on an ArchMenuTransferToAcd menu will return nothing.

Parameters:
Name Type Attributes Default Description
output string | ArchBranch

identifies output you want to obtain by name. If output is an ArchBranch instance, the ArchBranch#name value will be used. Remember that requesting the 'Success' output on an action with a fake success output will return nothing. For non-dynamic outputs, the name should be specified in English.

wantDynamicOutput boolean <optional>
false

because it is possible for some actions to have both a non-dynamic output and a dynamic output with the same name, this boolean will let you specify which output you want. An example of this would be the built in Failure output on a call bot action but that bot also has an intent named Failure so the action has two outputs with the same name of 'Failure'. Only one of those would be a dynamic output and that's the output for the Failure intent, not the built-in Failure action output.

Returns:
ArchActionOutput
Inherited From:

isFilterMatch(archFilterObject) → {boolean}

Returns whether or not this Architect Scripting object is a match for the supplied ArchFilterObject instance.

Parameters:
Name Type Description
archFilterObject ArchFilterObject

the object filter to use to determine if it's a match.

Returns:
boolean
Inherited From:

isTargetTransferTypeAvailable(transferTargetType, allowAnyLanguageopt) → {boolean}

Checks to see if the supplied transfer target type is available for either the supported languages configured on the parent flow or for any Architect language. The string values in ArchEnums#VOICEMAIL_TRANSFER_TARGET_TYPES list valid voicemail target type values.

Parameters:
Name Type Attributes Description
transferTargetType string

a value from ArchEnums#VOICEMAIL_TRANSFER_TARGET_TYPES

allowAnyLanguage boolean <optional>

if true, the check is made against all Architect languages instead of flow supported languages.

Returns:
boolean

logError(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true.

Parameters:
Name Type Description
errorStr string

the error string to log.

Inherited From:

logErrorAndThrow(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true and then throws the string in the errorStr parameter.

Parameters:
Name Type Description
errorStr string

the error string to log. This should be a non-blank string.

Throws:
  • Throws the submitted error string.
Inherited From:

logNote(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotes is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Inherited From:

logNoteVerbose(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotesVerbose is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Inherited From:

logWarning(warningStr)

Logs a warning to the logging service with a log header from this object's logStr property value when ArchLogging#logWarnings is true.

Parameters:
Name Type Description
warningStr string

the warning string to log. This should be a non-blank string.

Inherited From:

setScriptByIdAsync(scriptId, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

This sets the Composer script to associate with the voicemail transfer by the script id. Remember this script needs to be a script with the Voicemail feature set on it to be valid. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is: 'queue'

Parameters:
Name Type Attributes Description
scriptId string

the name of the voicemail script to set.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a function to call if the voicemail script is successfully looked up and configured on this action. The first parameter passed to the callback function will be this Transfer to Voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

setScriptByNameAsync(scriptName, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

This sets the Composer script to associate with the voicemail transfer by the script name. Remember this script needs to be a script with the Voicemail feature set on it to be valid. This will be validated / used at runtime when the ArchActionTransferToVoicemail#transferTargetType is:

  • 'queue'
Parameters:
Name Type Attributes Description
scriptName string

the name of the voicemail script to set.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a function to call if the voicemail script is successfully looked up and configured on this action. The first parameter passed to the callback function will be this Transfer to Voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

setTargetGroupLiteralByGroupIdAsync(groupId, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

Sets the voicemail to transfer to the specified group by id and if the group exists then ArchActionTransferToVoicemail#transferTargetType will be set to 'group'. Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

Parameters:
Name Type Attributes Description
groupId string

the group id for the voicemail transfer.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a callback function to call if the group is successfully looked up and configured on this action. The first parameter passed to the callback function will be this transfer to voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

setTargetGroupLiteralByGroupNameAsync(groupName, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

Sets the voicemail to transfer to the specified group by name and if the group exists then ArchActionTransferToVoicemail#transferTargetType will be set to 'group'. Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

Parameters:
Name Type Attributes Description
groupName string

the group name for the voicemail transfer.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a callback function to call if the group is successfully looked up and configured on this action. The first parameter passed to the callback function will be this transfer to voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

setTargetQueueLiteralByQueueIdAsync(queueId, callbackFunctionopt) → {Promise.<any>}

Sets the voicemail to transfer to the specified queue by id and if the queue exists then ArchActionTransferToVoicemail#transferTargetType will be set to 'queue'. Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so. Also, the target queue cannot be set when this action is used within an in-queue call flow.

Parameters:
Name Type Attributes Description
queueId string

the queue id for the voicemail transfer.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a callback function to call if the queue is successfully looked up and configured on this action. The first parameter passed to the callback function will be this transfer to voicemail instance.

Returns:
Promise.<any>

setTargetQueueLiteralByQueueNameAsync(queueName, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

Sets the voicemail to transfer to the specified queue by name and if the queue exists then ArchActionTransferToVoicemail#transferTargetType will be set to 'queue'. Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so. Also, the target queue cannot be set when this action is used within an in-queue call flow.

Parameters:
Name Type Attributes Description
queueName string

the queue name for the voicemail transfer.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a callback function to call if the queue is successfully looked up and configured on this action. The first parameter passed to the callback function will be this transfer to voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

setTargetUserLiteralByUserIdAsync(userId, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

Sets the voicemail to transfer to the specified user by id and if the user exists then ArchActionTransferToVoicemail#transferTargetType will be set to 'user'. Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

Parameters:
Name Type Attributes Description
userId string

the identifier of the user.

callbackFunction callbackArchActionTransferToVoicemail <optional>

a callback function to call if the user is successfully looked up and configured on this action. The first parameter passed to the callback function will be this transfer to voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

setTargetUserLiteralByUserNameAsync(userName, callbackFunctionopt) → {Promise.<ArchActionTransferToVoicemail>}

Sets the voicemail to transfer to the specified user by name and if the user exists then ArchActionTransferToVoicemail#transferTargetType will be set to 'user'. Note: Do not attempt to set a value for this property if the transfer type is not set to a value listed above as as it will not be writable and throw an error if you attempt to do so.

Parameters:
Name Type Attributes Description
userName string

the username for the user ( i.e. the user's email ).

callbackFunction callbackArchActionTransferToVoicemail <optional>

a callback function to call if the user is successfully looked up and configured on this action. The first parameter passed to the callback function will be this transfer to voicemail instance.

Returns:
Promise.<ArchActionTransferToVoicemail>

traverse(callbackFunction, traverseFilteropt) → {number}

This method iterates over this object and ArchBaseCoreObject instances within it. For each object it will call the ArchBaseObject#isFilterMatch method with a filter and call the supplied callback function if isMatch returns true. The callback will be passed an ArchTraverseInfo with details about the match such as the match object itself along with current contextual information such as the object hierarchy for the match object relative to the object on which this traverse call is being made.

The traverse filter is one which you can create by calling ArchFactoryFilters#createFilterObject and then add desired clauses or clause containers to it. If not specified, this function will use a default filter.

Here is an example that does a simple flow traversal using the default filter and logs information about objects in the callback from the traverse object that's passed back:

archInboundCallFlow.traverse(function(traverseInfo) {
   archLogging.logNote('  Object     : ' + traverseInfo.matchObject.logStr);
   archLogging.logNote('    Hierarchy: ' + traverseInfo.context.hierarchyStr);
});

This might be enough for most uses and you can check various aspects about the object in the callback such as "is this an Architect action?" by seeing if traverseInfo.matchObject.isArchBaseAction is true. You can specify a filter for the traversal code to use as well and only have it call your callback when the object's ArchBaseCoreObject#isFilterMatch method returns true for the filter. Here's an example that creates a filter for callbacks on any type of transfer action, any decision action or objects whose name property case insensitively matches the word 'foo'. While this could all be done with one property callback clause the example will use multiple clauses for the sake of simplicity:

const myTraverseFilter = filterFactory.createFilterObject(archEnums.FILTER_CONTAINER_OPERATORS.or);
myTraverseFilter.addClausePropertyValueEquals('isArchBaseActionTransfer', true);
myTraverseFilter.addClausePropertyValueEquals('isArchActionDecision',     true);
myTraverseFilter.addClausePropertyCallback('name', function(propValue, archContainingObject, propName) {
      // We fully spelled out the function signature above but archContainingObject and propName are
      // not needed in this case.  The archContainingObject is the object that contains the
      // property and propName is the property name itself.  We pass in propName because the same
      // function could be used for multiple property callback clauses.
      // Remember to return a boolean true, false or undefined from ths callback.  :)
      return propValue && propValue.toLowerCase() === 'foo';
});
archTask.traverse(function(traverseContext) {
   // You will only be called back here for ArchBaseCoreObject instances that
   // have the isArchBaseActionTransfer or isArchActionDecision property values equal to true.
}, myTraverseFilter);

If you supply a filter with no clauses, this tells the traverse method to call the supplied callback function for every ArchBaseCoreObject it traverses.

If you want traversal itself to stop after a callback, simply return boolean false from the callback function you supply to the traverse call.

The traverse method does not process deprecated property names such as orgId, orgName or languageSettings. Additionally it does not traverse in to properties that would "jump out" of the current traversal. An example of this would be if the code was traversing an ArchActionJumpToMenu action that it would not start traversing in to the menu that it jumps to. Another example would be a ArchActionChangeState action where it would not traverse in to the target state of the action. This also means traversal does not traverse in to the ArchBaseValue#flowLevelDefault property.

And lastly, as Scripting evolves over time with new versions, you can expect to get callbacks for new object types such as new actions or new properties on objects. As such, it's important not to assume any particular order in callbacks to keep code most compatible with traversal callbacks. Or if you use inequality checks in filter clauses remember that new "stuff" may satisfy an inequality check which may or may not be anticipated in your logic.

Note: This traverse method is a helper method and is very handy for iterating over Architect Scripting objects and their properties in a generic fashion with filtering capabilities. Obviously you can write your own custom traversal code if this implementation doesn't cut it for some reason. :)

This function returns the number of times it called the callback function.

Parameters:
Name Type Attributes Default Description
callbackFunction callbackTraverseInfo

the callback function to call for objects that match the traverse filter.

traverseFilter ArchFilterObject <optional>
ArchFactoryFilters#createFilterTraverseDefault

the filter to use when performing the traversal to determine which ArchBaseCoreObject instances you wish to be called back for. If no filter is specified, this function will call ArchFactoryFilters#createFilterTraverseDefault and use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.

Returns:
number
Inherited From: