Relay.Calling.SendDigitsAction

View as Markdown

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.

Parameters

None

Returns

string - UUID to identify the action.

Examples

Send some digits and print the controlId.

1<?php
2
3$call->sendDigitsAsync('1234')->done(function($action) {
4 echo $action->getControlId();
5});

getPayload

Return the payload sent to Relay to initiate the request. Useful to inspect what you sent to perform this action.

Parameters

None

Returns

Object - Payload sent to Relay.

Examples

Send some digits and print out the payload.

1<?php
2
3$call->sendDigitsAsync('1234')->done(function($action) {
4 print_r($action->getPayload());
5});

getResult

Returns the final result of the send digits operation.

Parameters

None

Returns

Relay.Calling.SendDigitsResult - Final result of the operation.

Examples

Send some digits and grab the result when it’s completed.

1<?php
2
3$call->sendDigitsAsync('1234')->done(function($action) {
4 // .. later in the code since it's an async method
5 if ($action->isCompleted()) {
6 $sendDigitsResult = $action->getResult();
7 }
8});

getState

Return the current state of the operation.

Parameters

None

Returns

string - Current operation’s state.

Examples

Send some digits and print the state.

1<?php
2
3$call->sendDigitsAsync('1234')->done(function($action) {
4 echo $action->getState();
5});

isCompleted

Return true if the operation has finished, false otherwise.

Parameters

None

Returns

Boolean - True/False accordingly to the state.

Examples

Send some digits and check if it has finished.

1<?php
2
3$call->sendDigitsAsync('1234')->done(function($action) {
4 if ($action->isCompleted()) {
5
6 }
7});