Relay.Calling.FaxResult

View as Markdown

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.

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

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.

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

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.

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

GetIdentity

Returns the identity sending the fax.

Parameters

None

Returns

string - Identity that sent the document.

Examples

Receiving fax and print the identity.

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

GetPages

Returns the number of pages in the document.

Parameters

None

Returns

number - Number of pages.

Examples

Print the number of received pages.

1call.OnFaxFinished = func(faxAction *signalwire.FaxAction) {
2 signalwire.Log.Info("Download Document from %s\n Pages #%d\n", faxAction.GetDocument(), faxAction.GetPages())
3}

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.

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

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.

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