Свойство | Тип | Описание | |
---|---|---|---|
$state | integer | Node state. |
Метод | Описание | |
---|---|---|
__toString ( ) : string | A classic! | |
addPrePromptMessage ( string $filename ) : void | Adds a sound file to play as a pre prompt message. | |
cancelWith ( string $digit ) : |
Configures a specific digit as the cancel digit. | |
cancelWithInputRetriesInput ( ) : |
Allow the user to retry input by pressing the cancel digit after entered one or more digits. For example, when entering a 12 number pin, the user might press the cancel digit at the 5th digit to re-enter it. This counts as a failed input, but will not cancel the node. The node will be cancelled only if the user presses the cancel digit with NO input at all. | |
clearPromptMessages ( ) : |
Removes prompt messages. | |
createValidatorInfo ( Closure $validation, string | null $soundOnError = null ) : validatorInfo | Given a callback and an optional sound to play on error, this will return a validator information structure to be used with validateInputWith(). | |
delCustomData ( string $key ) : |
Remove a key/value from the registry. | |
dontAcceptPrePromptInputAsInput ( ) : |
Digits entered during the pre prompt messages are not considered as node input. | |
endInputWith ( string $digit ) : |
Configures a specific digit as the end of input digit. | |
executeAfterFailedValidation ( Closure $callback ) : |
Executes after the 1st failed validation. | |
executeAfterRun ( Closure $callback ) : |
Executes after running the node. | |
executeBeforeRun ( Closure $callback ) : |
Executes before running the node. | |
executeOnInputFailed ( Closure $callback ) : |
Executes a callback when the node fails to properly get input from the user (either because of cancel, max attempts reached, timeout). | |
executeOnValidInput ( Closure $callback ) : |
Specify a callback function to invoke when the user entered a valid input. | |
expectAtLeast ( integer $length ) : |
Configure the node to expect at least this many digits. The input is considered complete when this many digits has been entered. Cancel and end of input digits (if configured) are not taken into account. | |
expectAtMost ( integer $length ) : |
Configure the node to expect at most this many digits. The reading loop will try to read this many digits. | |
expectExactly ( integer $length ) : |
Configure this node to expect at least and at most this many digits. | |
getClient ( ) : PAGI\Client\IClient | Returns the agi client in use. | |
getCustomData ( string $key ) : mixed | Returns the value for the given key in the registry. | |
getInput ( ) : string | Returns input. | |
getName ( ) : string | Returns the node name. | |
getTotalInputAttemptsUsed ( ) : integer | Returns the total number of input attempts used by the user. | |
hasCustomData ( string $key ) : boolean | True if the given key exists in the registry. | |
hasInput ( ) : boolean | True if this node has at least 1 digit as input, excluding cancel and end of input digits. | |
inputLengthIsAtLeast ( integer $length ) : boolean | True if this node has at least this many digits entered. | |
isComplete ( ) : boolean | True if this node is in COMPLETE state. | |
isTimeout ( ) : boolean | True if this node is in TIMEOUT state. | |
loadValidatorsFrom ( array $validatorsInformation ) : |
Given an array of validator information structures, this will load all validators into this node. | |
maxAttemptsForInput ( integer $number ) : |
Specify a maximum attempt number for the user to enter a valid input. | |
maxInputsReached ( ) : boolean | True if the user reached the maximum allowed attempts for valid input. | |
maxTimeBetweenDigits ( integer $milliseconds ) : |
Configures the maximum time available between digits before a timeout. | |
maxTotalTimeForInput ( integer $milliseconds ) : |
Configures the maximum time available for the user to enter valid input per attempt. | |
playNoInputMessageOnLastAttempt ( ) : |
Forces to play "no input" message on last attempt too. | |
playOnMaxValidInputAttempts ( string $filename ) : |
Optional message to play when the user exhausted all the available attempts to enter a valid input. | |
playOnNoInput ( string $filename ) : |
Specify an optional message to play when the user did not enter any input at all. By default, will NOT be played if this happens in the last allowed attempt. | |
prePromptMessagesNotInterruptable ( ) : |
Make pre prompt messages not interruptable | |
run ( ) : |
Executes this node. | |
saveCustomData ( string $key, mixed $value ) : |
Saves a custom key/value to the registry. | |
sayDateTime ( integer $timestamp, string $format ) : |
Loads a prompt message for saying a date/time expressed by a unix timestamp and a format. | |
sayDigits ( integer $digits ) : |
Loads a prompt message for saying the digits of the given number. | |
sayNumber ( integer $number ) : |
Loads a prompt message for saying a number. | |
saySound ( string $filename ) : |
Loads a prompt message for playing an audio file. | |
setAgiClient ( PAGI\Client\IClient $client ) : |
Sets the pagi client to use by this node. | |
setName ( string $name ) : |
Gives a name for this node. | |
unInterruptablePrompts ( ) : |
Make prompt messages not interruptable. | |
validate ( ) : boolean | Calls all validators in order. Will stop when any of them returns false. | |
validateInputWith ( string $name, Closure $validation, string | null $soundOnError = null ) : |
Add an input validation to this node. | |
wasCancelled ( ) : boolean | True if this node is in CANCEL state. |
Метод | Описание | |
---|---|---|
acceptInput ( string $digit ) : void | Process a single digit input by the user. Changes the node state according to the digit entered (CANCEL, COMPLETE). | |
addClientMethodCall ( ) : void | Internally used to execute prompt messages in the agi client. | |
addPrePromptClientMethodCall ( ) : void | Internally used to execute pre prompt messages in the agi client. | |
appendInput ( string $digit ) : void | Appends an input to the node input. | |
beforeOnInputFailed ( ) : void | Convenient hook to execute before calling the onInputFailed callback. | |
beforeOnValidInput ( ) : void | Convenient hook to execute before calling the onValidInput callback. | |
callClientMethod ( string $name, array $arguments = [] ) : PAGI\Client\Result\IResult | Call a specific method on a client. | |
callClientMethods ( methodInfo[] $methods, Closure $stopWhen = null ) : PAGI\Client\Result\IResult | Calls methods in the PAGI client. | |
clearPrePromptMessages ( ) : void | Internally used to clear pre prompt messages after being played. | |
doInput ( ) : void | Internally used to accept input from the user. Plays pre prompt messages, prompt, and waits for a complete input or cancel. | |
evaluateInput ( string $digit ) : integer | Returns the kind of digit entered by the user, CANCEL, END, NORMAL. | |
inputIsCancel ( string $digit ) : boolean | True if the digit matches the cancel digit. | |
inputIsEnd ( string $digit ) : boolean | True if the digit matches the end of input digit. | |
logDebug ( string $msg ) : void | Used internally to log debug messages | |
playPrePromptMessages ( ) : PAGI\Client\Result\IResult | Internally used to play all pre prompt queued messages. Clears the queue after it. | |
playPromptMessages ( ) : PAGI\Client\Result\IResult | null | Plays pre prompt messages, like error messages from validations. | |
resetInput ( ) : |
Internally used to clear the input per input attempt. Also resets state to TIMEOUT. | |
stateToString ( integer $state ) : string | Maps the current node state to a human readable string. |
protected acceptInput ( string $digit ) : void | ||
$digit | string | |
Результат | void |
protected addClientMethodCall ( ) : void | ||
Результат | void |
protected addPrePromptClientMethodCall ( ) : void | ||
Результат | void |
public addPrePromptMessage ( string $filename ) : void | ||
$filename | string | |
Результат | void |
protected appendInput ( string $digit ) : void | ||
$digit | string | A single character, one of the DTMF_* constants. |
Результат | void |
protected beforeOnInputFailed ( ) : void | ||
Результат | void |
protected beforeOnValidInput ( ) : void | ||
Результат | void |
protected callClientMethod ( string $name, array $arguments = [] ) : PAGI\Client\Result\IResult | ||
$name | string | |
$arguments | array | |
Результат | PAGI\Client\Result\IResult |
protected callClientMethods ( methodInfo[] $methods, Closure $stopWhen = null ) : PAGI\Client\Result\IResult | ||
$methods | methodInfo[] | Methods to call, an array of arrays. The second array has the method name as key and an array of arguments as value. |
$stopWhen | Closure | If any, this callback is evaluated before returning. Will return when false. |
Результат | PAGI\Client\Result\IResult |
public cancelWith ( string $digit ) : |
||
$digit | string | A single character, one of the DTMF_* constants. |
Результат |
public cancelWithInputRetriesInput ( ) : |
||
Результат |
protected clearPrePromptMessages ( ) : void | ||
Результат | void |
public clearPromptMessages ( ) : |
||
Результат |
public delCustomData ( string $key ) : |
||
$key | string | |
Результат |
public dontAcceptPrePromptInputAsInput ( ) : |
||
Результат |
public endInputWith ( string $digit ) : |
||
$digit | string | A single character, one of the DTMF_* constants. |
Результат |
protected evaluateInput ( string $digit ) : integer | ||
$digit | string | A single character, one of the DTMF_* constants. |
Результат | integer |
public executeAfterFailedValidation ( Closure $callback ) : |
||
$callback | Closure | |
Результат |
public executeAfterRun ( Closure $callback ) : |
||
$callback | Closure | |
Результат |
public executeBeforeRun ( Closure $callback ) : |
||
$callback | Closure | |
Результат |
public executeOnInputFailed ( Closure $callback ) : |
||
$callback | Closure | |
Результат |
public executeOnValidInput ( Closure $callback ) : |
||
$callback | Closure | |
Результат |
public expectAtLeast ( integer $length ) : |
||
$length | integer | |
Результат |
public expectAtMost ( integer $length ) : |
||
$length | integer | |
Результат |
public expectExactly ( integer $length ) : |
||
$length | integer | |
Результат |
public getClient ( ) : PAGI\Client\IClient | ||
Результат | PAGI\Client\IClient |
public getCustomData ( string $key ) : mixed | ||
$key | string | |
Результат | mixed |
public getTotalInputAttemptsUsed ( ) : integer | ||
Результат | integer |
public hasCustomData ( string $key ) : boolean | ||
$key | string | |
Результат | boolean |
protected inputIsCancel ( string $digit ) : boolean | ||
$digit | string | A single character, one of the DTMF_* constants. |
Результат | boolean |
protected inputIsEnd ( string $digit ) : boolean | ||
$digit | string | A single character, one of the DTMF_* constants. |
Результат | boolean |
public inputLengthIsAtLeast ( integer $length ) : boolean | ||
$length | integer | |
Результат | boolean |
public isComplete ( ) : boolean | ||
Результат | boolean |
public loadValidatorsFrom ( array $validatorsInformation ) : |
||
$validatorsInformation | array | |
Результат |
public maxAttemptsForInput ( integer $number ) : |
||
$number | integer | |
Результат |
public maxInputsReached ( ) : boolean | ||
Результат | boolean |
public maxTimeBetweenDigits ( integer $milliseconds ) : |
||
$milliseconds | integer | |
Результат |
public maxTotalTimeForInput ( integer $milliseconds ) : |
||
$milliseconds | integer | |
Результат |
public playNoInputMessageOnLastAttempt ( ) : |
||
Результат |
public playOnMaxValidInputAttempts ( string $filename ) : |
||
$filename | string | Sound file to play. |
Результат |
public playOnNoInput ( string $filename ) : |
||
$filename | string | Sound file to play. |
Результат |
protected playPrePromptMessages ( ) : PAGI\Client\Result\IResult | ||
Результат | PAGI\Client\Result\IResult |
protected playPromptMessages ( ) : PAGI\Client\Result\IResult | null | ||
Результат | PAGI\Client\Result\IResult | null |
public prePromptMessagesNotInterruptable ( ) : |
||
Результат |
protected resetInput ( ) : |
||
Результат |
public saveCustomData ( string $key, mixed $value ) : |
||
$key | string | |
$value | mixed | |
Результат |
public sayDateTime ( integer $timestamp, string $format ) : |
||
$timestamp | integer | |
$format | string | |
Результат |
public setAgiClient ( PAGI\Client\IClient $client ) : |
||
$client | PAGI\Client\IClient | |
Результат |
protected stateToString ( integer $state ) : string | ||
$state | integer | One of the STATE_* constants. |
Результат | string |
public unInterruptablePrompts ( ) : |
||
Результат |
public wasCancelled ( ) : boolean | ||
Результат | boolean |