Skip to main content

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.

Available In:

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.

Available In:

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.

Available In:

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.

Available In:

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.

Available In:

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.

Available In:

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.

Available In:

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..
}
});