Relay.Calling.SendDigitsAction
This object is returned by sendDigitsAsync
method that represents a send digits operation currently active on a call.
Methods
getControlId
Return the UUID to identify the operation.
Available In:
Parameters
None
Returns
string
- UUID to identify the action.
Examples
<?php
$call->sendDigitsAsync('1234')->done(function($action) {
echo $action->getControlId();
});
getPayload
Return the payload sent to Relay to initiate the request. Useful to inspect what you sent to perform this action.
Available In:
Parameters
None
Returns
Object
- Payload sent to Relay.
Examples
<?php
$call->sendDigitsAsync('1234')->done(function($action) {
print_r($action->getPayload());
});
getResult
Returns the final result of the send digits operation.
Available In:
Parameters
None
Returns
Relay.Calling.SendDigitsResult
- Final result of the operation.
Examples
<?php
$call->sendDigitsAsync('1234')->done(function($action) {
// .. later in the code since it's an async method
if ($action->isCompleted()) {
$sendDigitsResult = $action->getResult();
}
});
getState
Return the current state of the operation.
Available In:
Parameters
None
Returns
string
- Current operation's state.
Examples
<?php
$call->sendDigitsAsync('1234')->done(function($action) {
echo $action->getState();
});
isCompleted
Return true
if the operation has finished, false
otherwise.
Available In:
Parameters
None
Returns
Boolean
- True/False accordingly to the state.
Examples
<?php
$call->sendDigitsAsync('1234')->done(function($action) {
if ($action->isCompleted()) {
}
});