Relay.Calling.SendDigitsAction

View as Markdown

Relay.Calling.SendDigitsAction

This object is returned by sendDigitsAsync method that represents a send digits operation currently active on a call.

Methods-submenu

GetResult

Returns the final result of the send digits operation.

Parameters

None

Returns

Relay.Calling.SendDigitsResult - Final result of the operation.

Examples

Show the Result.

1resultDial.Call.OnSendDigitsFinished = func(a *signalwire.SendDigitsAction) {
2 signalwire.Log.Info("SendDigits finished with result: [%v]\n", sendDigitsAction.GetResult())
3}

GetCompleted

Return true if the operation has finished, false otherwise.

Parameters

None

Returns

Boolean - True/False accordingly to the state.

Examples

Send some digits and check if it has finished.

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// SendDigits does not need a Stop() command.
12
13if sendDigitsAction.GetCompleted() {
14 // just print this again
15 signalwire.Log.Info("SendDigits finished with successful result: [%v]\n", sendDigitsAction.GetSuccessful())
16}

GetControlID

Return the UUID to identify the action.

Parameters

None

Returns

string - UUID to identify the action.