Relay.Calling.FaxResult
This object returned from faxReceive
and faxSend
methods that represents the final result of a sent or received Fax.
Methods
getDirection
Returns the direction of the fax: send
or receive
.
Parameters
None
Returns
string
- send or receive.
Examples
Start faxing and then check the direction.
<?php
$call->faxSend('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')->done(function($result) {
if ($result->isSuccessful()) {
echo $result->getDirection(); // => "send"
}
});
getEvent
Returns the last Relay Event arrived for this operation.
Parameters
None
Returns
Relay.Event
- Last Relay Event.
Examples
Send a document and then inspect the last received Relay event.
<?php
$call->faxSend('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')->done(function($result) {
if ($result->isSuccessful()) {
print_r($result->getEvent());
}
});
getDocument
Returns the URL to the document send or received.
Parameters
None
Returns
string
- URL to the document.
Examples
Receiving fax and print the URL of the document.
<?php
$call->faxReceive()->done(function($result) {
if ($result->isSuccessful()) {
echo $result->getDocument();
}
});
getIdentity
Returns the identity sending the fax.
Parameters
None
Returns
string
- Identity that sent the document.
Examples
Receiving fax and print the identity.
<?php
$call->faxReceive()->done(function($result) {
if ($result->isSuccessful()) {
echo $result->getIdentity();
}
});
getPages
Returns the number of pages in the document.
Parameters
None
Returns
number
- Number of pages.
Examples
Receiving fax and print the number of received pages.
<?php
$call->faxReceive()->done(function($result) {
if ($result->isSuccessful()) {
echo $result->getPages();
}
});
getRemoteIdentity
Returns the remote identity sent or receiving the Fax.
Parameters
None
Returns
string
- The remote identity.
Examples
Receiving fax and print the remote identity.
<?php
$call->faxReceive()->done(function($result) {
if ($result->isSuccessful()) {
echo $result->getRemoteIdentity();
}
});
isSuccessful
Return true
if faxing succeeded, false
otherwise.
Parameters
None
Returns
boolean
- True/False accordingly to the state.
Examples
Start sending a document and then check if it has sent successfully.
<?php
$call->faxSend('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')->done(function($result) {
if ($result->isSuccessful()) {
// Fax sent successfully..
}
});