[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/Services/Twilio/Rest/ -> Call.php (source)

   1  <?php
   2  
   3  /**
   4   *   For more information, see the `Call Instance Resource <http://www.twilio.com/docs/api/rest/call#instance>`_ documentation.
   5   *
   6   *   .. php:attr:: sid
   7   *
   8   *      A 34 character string that uniquely identifies this resource.
   9   *
  10   *   .. php:attr:: parent_call_sid
  11   *
  12   *      A 34 character string that uniquely identifies the call that created this leg.
  13   *
  14   *   .. php:attr:: date_created
  15   *
  16   *      The date that this resource was created, given as GMT in RFC 2822 format.
  17   *
  18   *   .. php:attr:: date_updated
  19   *
  20   *      The date that this resource was last updated, given as GMT in RFC 2822 format.
  21   *
  22   *   .. php:attr:: account_sid
  23   *
  24   *      The unique id of the Account responsible for creating this call.
  25   *
  26   *   .. php:attr:: to
  27   *
  28   *      The phone number that received this call. e.g., +16175551212 (E.164 format)
  29   *
  30   *   .. php:attr:: from
  31   *
  32   *      The phone number that made this call. e.g., +16175551212 (E.164 format)
  33   *
  34   *   .. php:attr:: phone_number_sid
  35   *
  36   *      If the call was inbound, this is the Sid of the IncomingPhoneNumber that
  37   *      received the call. If the call was outbound, it is the Sid of the
  38   *      OutgoingCallerId from which the call was placed.
  39   *
  40   *   .. php:attr:: status
  41   *
  42   *      A string representing the status of the call. May be `QUEUED`, `RINGING`,
  43   *      `IN-PROGRESS`, `COMPLETED`, `FAILED`, `BUSY` or `NO_ANSWER`.
  44   *
  45   *   .. php:attr:: stat_time
  46   *
  47   *      The start time of the call, given as GMT in RFC 2822 format. Empty if the call has not yet been dialed.
  48   *
  49   *   .. php:attr:: end_time
  50   *
  51   *      The end time of the call, given as GMT in RFC 2822 format. Empty if the call did not complete successfully.
  52   *
  53   *   .. php:attr:: duration
  54   *
  55   *      The length of the call in seconds. This value is empty for busy, failed, unanswered or ongoing calls.
  56   *
  57   *   .. php:attr:: price
  58   *
  59   *      The charge for this call in USD. Populated after the call is completed. May not be immediately available.
  60   *
  61   *   .. php:attr:: direction
  62   *
  63   *         A string describing the direction of the call. inbound for inbound
  64   *         calls, outbound-api for calls initiated via the REST API or
  65   *         outbound-dial for calls initiated by a <Dial> verb.
  66   *
  67   *   .. php:attr:: answered_by
  68   *
  69   *      If this call was initiated with answering machine detection, either human or machine. Empty otherwise.
  70   *
  71   *   .. php:attr:: forwarded_from
  72   *
  73   *        If this call was an incoming call forwarded from another number, the
  74   *        forwarding phone number (depends on carrier supporting forwarding).
  75   *        Empty otherwise.
  76   *
  77   *   .. php:attr:: caller_name
  78   *
  79   *      If this call was an incoming call from a phone number with Caller ID Lookup enabled, the caller's name. Empty otherwise.
  80   */
  81  class Services_Twilio_Rest_Call extends Services_Twilio_InstanceResource {
  82  
  83      /**
  84       * Hang up the call
  85       */
  86      public function hangup() {
  87          $this->update('Status', 'completed');
  88      }
  89  
  90      /**
  91       * Redirect the call to a new URL
  92       *
  93       * :param string $url: the new URL to retrieve call flow from.
  94       */
  95      public function route($url) {
  96          $this->update('Url', $url);
  97      }
  98  
  99      protected function init($client, $uri) {
 100          $this->setupSubresources(
 101              'notifications',
 102              'recordings'
 103          );
 104      }
 105  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1