Skip to main content

Relay.Calling.FaxResult

Relay.Calling.FaxResult

This object returned from faxReceive and faxSend methods that represents the final result of a sent or received Fax.

Methods-submenu

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.

call.OnFaxFinished = func(faxAction *signalwire.FaxAction) {
faxResult := faxAction.GetResult()
signalwire.Log.Info("Direction %d\n", faxResult.Direction)
// same as
signalwire.Log.Info("Direction %d\n", faxAction.GetDirection())
}
_, err := call.ReceiveFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to receive fax\n")
}

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.

_, err := call.SendFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to send fax\n")
}

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.

call.OnFaxFinished = func(faxAction *signalwire.FaxAction) {
signalwire.Log.Info("Download Document from %s\n Pages #%d\n", faxAction.GetDocument(), faxAction.GetPages())
}
_, err := call.ReceiveFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to receive fax\n")
}

GetIdentity

Returns the identity sending the fax.

Parameters

None

Returns

string - Identity that sent the document.

Examples

Receiving fax and print the identity.

_, err := call.SendFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to send fax\n")
}

GetPages

Returns the number of pages in the document.

Parameters

None

Returns

number - Number of pages.

Examples

Print the number of received pages.

call.OnFaxFinished = func(faxAction *signalwire.FaxAction) {
signalwire.Log.Info("Download Document from %s\n Pages #%d\n", faxAction.GetDocument(), faxAction.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.

_, err := call.SendFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to send fax\n")
}

GetSuccessful

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.

_, err := call.SendFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to send fax\n")
}