Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'fix-mute-participants'

  • Loading branch information...
commit f02e03367d052eb9700418284e4b0da2ddb2253d 2 parents ab14675 + 6720b2f
Kevin Burke authored
View
6 Services/Twilio/ListResource.php
@@ -49,10 +49,10 @@ public function get($sid)
* @return Services_Twilio_InstanceResource An instance with properties
* initialized to the values in the params array.
*/
- public function getObjectFromJson($params)
+ public function getObjectFromJson($params, $idParam = "sid")
{
- if (isset($params->sid)) {
- $uri = $this->uri . "/" . $params->sid;
+ if (isset($params->{$idParam})) {
+ $uri = $this->uri . "/" . $params->{$idParam};
} else {
$uri = $this->uri;
}
View
4 Services/Twilio/Rest/Participants.php
@@ -3,4 +3,8 @@
class Services_Twilio_Rest_Participants
extends Services_Twilio_ListResource
{
+ /* Participants are identified by CallSid, not like PI123 */
+ public function getObjectFromJson($params, $idParam = "sid") {
+ return parent::getObjectFromJson($params, "call_sid");
+ }
}
View
2  tests/TwilioTest.php
@@ -268,7 +268,7 @@ function testUnmute() {
'/2010-04-01/Accounts/AC123/Conferences/CF123/Participants.json?Page=0&PageSize=10')
->andReturn(array(200, array('Content-Type' => 'application/json'),
json_encode(array(
- 'participants' => array(array('sid' => 'CA123'))
+ 'participants' => array(array('call_sid' => 'CA123'))
))
));
$http->shouldReceive('post')->once()
Please sign in to comment.
Something went wrong with that request. Please try again.