Relay.Calling.FaxAction
This object returned from faxReceiveAsync
and faxSendAsync
methods represents a receiving or sending Fax on the call.
Methods
getControlId
Return the UUID to identify the fax action.
Available In:
Parameters
None
Returns
string
- UUID to identify the action.
Examples
<?php
$call->faxSendAsync('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')->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->faxSendAsync('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', '+1888222111', 'Custom Header')->done(function ($action) {
print_r($action->getPayload());
});
getResult
Returns the final result of the faxing.
Available In:
Parameters
None
Returns
Relay.Calling.FaxResult
- Final result of the faxing.
Examples
<?php
$call->faxReceiveAsync()->done(function($action) {
// .. later in the code since it's an async method
if ($action->isCompleted()) {
$faxResult = $action->getResult();
}
});
isCompleted
Return true
if faxing has finished, false
otherwise.
Available In:
Parameters
None
Returns
Boolean
- True/False accordingly to the state.
Examples
<?php
$call->faxReceiveAsync()->done(function($action) {
// .. later in the code since it's an async method
if ($action->isCompleted()) {
}
});
stop
Stop the action immediately.
Available In:
Parameters
None
Returns
React\Promise\Promise
- A React Promise
that will be resolved with the Relay response.
Examples
<?php
$call->faxReceiveAsync()->done(function ($faxAction) {
// For demonstration purposes only..
$faxAction->stop();
});