Skip to main content

Relay.Calling.DialResult

This object returned from Calling dial and Call dial methods.

Methods

getCall

Return the active Call object, right after the remote peer picked it up.

Available In:

Parameters

None

Returns

Relay.Calling.Call - The remote Call.

Examples

Trying to call a remote peer and, if it answer, get the active Call.
<?php

$params = [ 'type' => 'phone', 'from' => '+1XXXXXXXXXX', 'to' => '+1YYYYYYYYYY' ];
$client->calling->dial($params)->done(function($result) {
if ($result->isSuccessful()) {
$call = $result->getCall();
// Your active $call..
}
});

getEvent

Returns the last Relay Event arrived for this operation.

Available In:

Parameters

None

Returns

Relay.Event - Last Relay Event.

Examples

Start an outbound Call and then grab the Relay event to inspect the payload.
<?php

$call->dial()->done(function($result) {
$event = $result->getEvent();
// Inspect $event->payload ..
});

isSuccessful

Return true if the call was picked up by the remote party, false otherwise.

Available In:

Parameters

None

Returns

boolean - Whether the call has been answered.

Examples

Start an outbound Call and then check if the 'dial' has completed successfully.
<?php

$call->dial()->done(function($result) {
if ($result->isSuccessful()) {
// Your call has been answered by the remote party..
}
});