Skip to main content

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

Send some digits and print the controlId.
<?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

Send some digits and print out the payload.
<?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

Send some digits and grab the result when it's completed.
<?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

Send some digits and print the state.
<?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

Send some digits and check if it has finished.
<?php

$call->sendDigitsAsync('1234')->done(function($action) {
if ($action->isCompleted()) {

}
});