Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/./../app/.././../../finland.picotech.app/public_html/storage/../vendor/./phpoption/../telnyx/../nette/./../ramsey/../paypal/./../paytm/../phpdocumentor/../nesbot/../filp/whoops/../../theseer/../league/../././././plivo/../telnyx/telnyx-php/lib
الملفات الموجودة في هذا الـ Path:
.
..
Address.php
AlphanumericSenderID.php
ApiOperations
ApiRequestor.php
ApiResource.php
ApiResponse.php
AvailablePhoneNumber.php
Balance.php
BillingGroup.php
Brand.php
Call.php
CallControlApplication.php
Campaign.php
Collection.php
Conference.php
Connection.php
CredentialConnection.php
ErrorObject.php
Event.php
Exception
FQDN.php
FQDNConnection.php
Fax.php
FaxApplication.php
HttpClient
IP.php
IPConnection.php
InboundChannel.php
Message.php
MessagingHostedNumberOrder.php
MessagingPhoneNumber.php
MessagingProfile.php
MobileOperatorNetwork.php
NumberLookup.php
NumberOrder.php
NumberOrderDocument.php
NumberReservation.php
OtaUpdate.php
OutboundVoiceProfile.php
PhoneNumber
PhoneNumber.php
PhoneNumberAssignmentByProfile.php
PhoneNumberCampaign.php
PortingOrder.php
PortingPhoneNumber.php
Portout.php
RegulatoryRequirement.php
RequestTelemetry.php
ShortCode.php
SimCard.php
TelephonyCredential.php
Telnyx.php
TelnyxObject.php
Util
Verification.php
VerifyProfile.php
VerifyVerification.php
Webhook.php
WebhookSignature.php

مشاهدة ملف: Call.php

<?php

namespace Telnyx;

/**
 * Class Call
 *
 * @package Telnyx
 */
class Call extends ApiResource
{
    const OBJECT_NAME = "call";
    const OBJECT_ID = "call_control_id";

    use ApiOperations\Create;
    use ApiOperations\Retrieve;
    use ApiOperations\NestedResource; // NOTE: This might be unused.

    /**
     * Answer an incoming call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function answer($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/answer';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Bridge two call control calls.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function bridge($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/bridge';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return Forking start
     */
    public function fork_start($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/fork_start';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Stop forking a call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function fork_stop($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/fork_stop';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Play an audio file on the call until the required DTMF signals are
     * gathered to build interactive menus.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function gather_using_audio($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/gather_using_audio';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Convert text to speech and play it on the call until the required DTMF
     * signals are gathered to build interactive menus.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function gather_using_speak($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/gather_using_speak';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Hang up the call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function hangup($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/hangup';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Play an audio file on the call. If multiple play audio commands are
     * issued consecutively, the audio files will be placed in a queue awaiting
     * playback.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function playback_start($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/playback_start';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Stop audio being played on the call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function playback_stop($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/playback_stop';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Start recording the call. Recording will stop on call hang-up, or can be
     * initiated via the Stop Recording command.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function record_start($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/record_start';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Stop recording the call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function record_stop($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/record_stop';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Reject an incoming call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function reject($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/reject';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Sends DTMF tones from this leg. DTMF tones will be heard by the other
     * end of the call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function send_dtmf($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/send_dtmf';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Convert text to speech and play it back on the call. If multiple speak
     * text commands are issued consecutively, the audio files will be placed
     * in a queue awaiting playback.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function speak($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/speak';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Transfer a call to a new destination. If the transfer is unsuccessful,
     * a call.hangup webhook will be sent indicating that the transfer could
     * not be completed. The original call will remain active and may be issued
     * additional commands, potentially transfering the call to an alternate
     * destination.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function transfer($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/transfer';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Start real-time transcription. Transcription will stop on call hang-up,
     * or can be initiated via the Transcription stop command.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function transcription_start($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/transcription_start';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Stop real-time transcription.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function transcription_stop($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/transcription_stop';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Pause recording the call. Recording can be resumed via Resume recording command.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function record_pause($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/record_pause';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Resume recording the call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function record_resume($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/record_resume';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Stop current gather.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function gather_stop($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/gather_stop';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * SIP Refer a call
     *
     * Initiate a SIP Refer on a Call Control call. You can initiate a SIP Refer
     * at any point in the duration of a call.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function refer($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/refer';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Enqueue call
     *
     * Put the call in a queue.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function enqueue($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/enqueue';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

    /**
     * Remove call from a queue
     *
     * Removes the call from a queue.
     *
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return
     */
    public function leave_queue($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/actions/leave_queue';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }

}