Relay.Calling.FaxAction
Relay.Calling.FaxAction​
This object returned from faxReceiveAsync
and faxSendAsync
methods represents a receiving or sending Fax on the call.
Methods-submenu​
GetResult​
Returns the final result of the faxing.
Parameters
None
Returns
Relay.Calling.FaxResult
- Final result of the faxing.
Examples
Trying receiving a Fax and grab the result when it's completed.
call.OnFaxFinished = func(faxAction *signalwire.FaxAction) {
faxResult := faxAction.GetResult()
signalwire.Log.Info("Download Document from %s\n Pages #%d\n", faxResult.Document, faxResult.Pages)
}
_, err := call.ReceiveFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to receive fax\n")
}
GetCompleted​
Return true
if faxing has finished, false
otherwise.
Parameters
None
Returns
Boolean
- True/False accordingly to the state.
Examples
Trying receiving a Fax and check if it has finished.
faxAction, err := call.ReceiveFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to receive fax\n")
}
for {
time.Sleep(1 * time.Second)
if faxAction.GetCompleted() {
break
}
}
Stop​
Stop the action immediately.
Parameters
None
Returns
Examples
Trying to receive a Fax and then stop the attempt.
faxAction, err := call.ReceiveFaxAsync()
if err != nil {
signalwire.Log.Error("Error occurred while trying to receive fax\n")
}
time.Sleep(3 * time.Second)
faxAction.Stop()