Skip to main content

Relay.Calling.SendDigitsAction

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.

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

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.

/* use an anonymous function as CB */
resultDial.Call.OnSendDigitsFinished = func(a *signalwire.SendDigitsAction) {
signalwire.Log.Info("SendDigits finished with successful result: [%v]\n", a.GetSuccessful())
}

sendDigitsAction, err := resultDial.Call.SendDigitsAsync("1234567890*#")
if err != nil {
signalwire.Log.Error("Error occurred while trying to play audio\n")
}

// SendDigits does not need a Stop() command.

if sendDigitsAction.GetCompleted() {
// just print this again
signalwire.Log.Info("SendDigits finished with successful result: [%v]\n", sendDigitsAction.GetSuccessful())
}

GetControlID

Return the UUID to identify the action.

Parameters

None

Returns

string - UUID to identify the action.