Skip to main content

Relay.Calling.TapResult

Relay.Calling.TapResult

This object returned from tap method that represents the final result of a tapping.

Methods-submenu

GetDestinationDevice

Returns the destination device receiving media.

Parameters

None

Returns

Object - The destination device.

Examples

Tap audio and then inspect the destination device.

var tapdevice signalwire.TapDevice
tapdevice.Type = signalwire.TapRTP.String()
tapdevice.Params.Addr = "82.47.225.162"
tapdevice.Params.Port = 1234
tapdevice.Params.Codec = "PCMU"
tapAction, err := resultDial.Call.TapAudioAsync(signalwire.TapDirectionListen, &tapdevice)
if err != nil {
signalwire.Log.Fatal("Error occurred while trying to tap audio: %v\n", err)
}
time.Sleep(10 * time.Second)
tapAction.Stop()
signalwire.Log.Info("Tap: %v Result: %v\n", tapAction.GetTap(), tapAction.GetResult())
signalwire.Log.Info("SourceDevice: %v\n", tapAction.GetSourceDevice()) // comes from the Signalwire platform
signalwire.Log.Info("DestinationDevice: %v\n", tapAction.GetDestinationDevice()) // the device passed above

GetEvent

Returns the last Relay Event arrived for this operation.

Parameters

None

Returns

Relay.Event - Last Relay Event.

GetSourceDevice

Returns the source device sending media.

Parameters

None

Returns

Object - The source device.

Examples

Inspect the source device.

signalwire.Log.Info("SourceDevice: %v\n", tapAction.GetSourceDevice())           // comes from the Signalwire platform

GetTap

Returns the params for this tap action.

Parameters

None

Returns

signalwire.Tap

Examples

Inspect the tap params.

signalwire.Log.Info("Tap: %v Result: %v\n", tapAction.GetTap(), tapAction.GetResult())

GetSuccessful

Return true if the tapping succeeded, false otherwise.

Parameters

None

Returns

Boolean - True/False accordingly to the state.