Relay.Calling.SendDigitsResult

View as Markdown

Relay.Calling.SendDigitsResult

This object is returned by sendDigits method and represents the final result of a send digits action.

Methods-submenu

GetEvent

Returns the last Relay Event arrived for this operation.

Parameters

None

Returns

*signalwire.Event - Last Relay Event.

GetSuccessful

Return true if the operation has succeeded, false otherwise.

Parameters

None

Returns

bool - Whether the operation has completed successfully.

Examples

Send some digits and then check if it has ended successfully.

1/* use an anonymous function as CB */
2resultDial.Call.OnSendDigitsFinished = func(a *signalwire.SendDigitsAction) {
3 signalwire.Log.Info("SendDigits finished with successful result: [%v]\n", a.GetSuccessful())
4}
5
6sendDigitsAction, err := resultDial.Call.SendDigitsAsync("1234567890*#")
7if err != nil {
8 signalwire.Log.Error("Error occurred while trying to play audio\n")
9}
10
11// do something more here
12time.Sleep(2 * time.Second)
13
14if sendDigitsAction.GetCompleted() {
15 // just print this again
16 signalwire.Log.Info("SendDigits finished with successful result: [%v]\n", sendDigitsAction.GetSuccessful())
17}