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.
Available In:
Parameters
None
Returns
Object
- The destination device.
Examples
Tapping audio from the call and then inspect the destination device.
<?php
$tap = [
'target_type' => 'rtp',
'target_addr' => '192.168.1.1',
'target_port' => 1234
];
$call->tap($tap)->done(function($result) {
if ($result->isSuccessful()) {
$destination = $result->getDestinationDevice();
}
});
getEvent
Returns the last Relay Event arrived for this operation.
Available In:
Parameters
None
Returns
Relay.Event
- Last Relay Event.
Examples
Tapping audio from the call and grab the result when it's completed.
<?php
$tap = [
'target_type' => 'rtp',
'target_addr' => '192.168.1.1',
'target_port' => 1234
];
$call->tap($tap)->done(function($result) {
$event = $result->getEvent();
// Inspect $event->payload ..
});
getSourceDevice
Returns the source
device sending media.
Available In:
Parameters
None
Returns
Object
- The source device.
Examples
Tapping audio from the call and then inspect the source device.
<?php
$tap = [
'target_type' => 'rtp',
'target_addr' => '192.168.1.1',
'target_port' => 1234
];
$call->tap($tap)->done(function($result) {
if ($result->isSuccessful()) {
$source = $result->getSourceDevice();
}
});
getTap
Returns the payload for this tap
action.
Available In:
Parameters
None
Returns
Object
- Payload used to start tapping.
Examples
Tapping audio from the call and then inspect the 'tap' payload.
<?php
$tap = [
'target_type' => 'rtp',
'target_addr' => '192.168.1.1',
'target_port' => 1234
];
$call->tap($tap)->done(function($result) {
if ($result->isSuccessful()) {
$tap = $result->getTap();
}
});
isSuccessful
Return true
if the tapping succeeded, false
otherwise.
Available In:
Parameters
None
Returns
Boolean
- True/False accordingly to the state.
Examples
Tapping audio from the call and then check if it has ended successfully.
<?php
$tap = [
'target_type' => 'rtp',
'target_addr' => '192.168.1.1',
'target_port' => 1234
];
$call->tap($tap)->done(function($result) {
if ($result->isSuccessful()) {
}
});