Tap Result

View as Markdown

Relay.Calling.TapResult

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

Methods

getDestinationDevice

Returns the destination device receiving media.

Parameters

None

Returns

Object - The destination device.

Examples

Tapping audio from the call and then inspect the destination device.

1<?php
2
3$tap = [
4 'target_type' => 'rtp',
5 'target_addr' => '192.168.1.1',
6 'target_port' => 1234
7];
8$call->tap($tap)->done(function($result) {
9 if ($result->isSuccessful()) {
10 $destination = $result->getDestinationDevice();
11 }
12});

getEvent

Returns the last Relay Event arrived for this operation.

Parameters

None

Returns

Relay.Event - Last Relay Event.

Examples

Tapping audio from the call and grab the result when it’s completed.

1<?php
2
3$tap = [
4 'target_type' => 'rtp',
5 'target_addr' => '192.168.1.1',
6 'target_port' => 1234
7];
8$call->tap($tap)->done(function($result) {
9 $event = $result->getEvent();
10 // Inspect $event->payload ..
11});

getSourceDevice

Returns the source device sending media.

Parameters

None

Returns

Object - The source device.

Examples

Tapping audio from the call and then inspect the source device.

1<?php
2
3$tap = [
4 'target_type' => 'rtp',
5 'target_addr' => '192.168.1.1',
6 'target_port' => 1234
7];
8$call->tap($tap)->done(function($result) {
9 if ($result->isSuccessful()) {
10 $source = $result->getSourceDevice();
11 }
12});

getTap

Returns the payload for this tap action.

Parameters

None

Returns

Object - Payload used to start tapping.

Examples

Tapping audio from the call and then inspect the tap payload.

1<?php
2
3$tap = [
4 'target_type' => 'rtp',
5 'target_addr' => '192.168.1.1',
6 'target_port' => 1234
7];
8$call->tap($tap)->done(function($result) {
9 if ($result->isSuccessful()) {
10 $tap = $result->getTap();
11 }
12});

isSuccessful

Return true if the tapping succeeded, false otherwise.

Parameters

None

Returns

Boolean - True/False accordingly to the state.

Examples

Tapping audio from the call and then check if it has ended successfully.

1<?php
2
3$tap = [
4 'target_type' => 'rtp',
5 'target_addr' => '192.168.1.1',
6 'target_port' => 1234
7];
8$call->tap($tap)->done(function($result) {
9 if ($result->isSuccessful()) {
10
11 }
12});