Skip to content

Commit 404f318

Browse files
authored
Merge pull request #322 from opentok/fix_sip_observeforcemute
Fix sip observeforcemute
2 parents 4d2b60d + a2f074b commit 404f318

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

src/OpenTok/SipCall.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
* The ID of the stream connected to the OpenTok session streaming the audio received from
1818
* the SIP call.
1919
*
20-
* @property bool $observeForceMute
21-
* Whether the SIP call honors
22-
* <a href="https://tokbox.com/developer/guides/moderation/#force_mute">force mute moderation</a>.
2320
*/
2421
class SipCall
2522
{
@@ -32,7 +29,6 @@ public function __construct($sipCallData)
3229
$this->data['id'] = $sipCallData['id'];
3330
$this->data['connectionId'] = $sipCallData['connectionId'];
3431
$this->data['streamId'] = $sipCallData['streamId'];
35-
$this->data['observeForceMute'] = $sipCallData['observeForceMute'];
3632
}
3733

3834
/**
@@ -45,7 +41,6 @@ public function __get($name)
4541
case 'id':
4642
case 'connectionId':
4743
case 'streamId':
48-
case 'observeForceMute':
4944
return $this->data[$name];
5045
default:
5146
return null;

tests/OpenTokTest/OpenTokTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
use OpenTok\MediaMode;
1010
use ArgumentCountError;
1111
use DomainException;
12-
use Exception;
13-
use GuzzleHttp\Exception\GuzzleException;
1412
use OpenTok\OutputMode;
1513
use OpenTok\ArchiveMode;
1614
use OpenTok\StreamMode;
@@ -19,12 +17,7 @@
1917
use GuzzleHttp\HandlerStack;
2018
use PHPUnit\Framework\TestCase;
2119
use GuzzleHttp\Handler\MockHandler;
22-
use InvalidArgumentException as GlobalInvalidArgumentException;
23-
use OpenTok\Exception\AuthenticationException;
24-
use OpenTok\Exception\DomainException as ExceptionDomainException;
2520
use OpenTok\Exception\InvalidArgumentException;
26-
use RuntimeException;
27-
use OpenTok\Exception\UnexpectedValueException;
2821

2922
define('OPENTOK_DEBUG', true);
3023

@@ -2237,7 +2230,6 @@ public function testSipCallVideo(): void
22372230
$this->assertNotNull($sipCall->id);
22382231
$this->assertNotNull($sipCall->connectionId);
22392232
$this->assertNotNull($sipCall->streamId);
2240-
$this->assertEquals(false, $sipCall->observeForceMute);
22412233

22422234
$this->assertCount(1, $this->historyContainer);
22432235
$request = $this->historyContainer[0]['request'];
@@ -2271,7 +2263,6 @@ public function testSipCallVideoWithObserveForceMute(): void
22712263
$this->assertNotNull($sipCall->id);
22722264
$this->assertNotNull($sipCall->connectionId);
22732265
$this->assertNotNull($sipCall->streamId);
2274-
$this->assertEquals(true, $sipCall->observeForceMute);
22752266

22762267
$this->assertCount(1, $this->historyContainer);
22772268
$request = $this->historyContainer[0]['request'];

tests/OpenTokTest/SipCallTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
namespace OpenTokTest;
3+
4+
use OpenTok\SipCall;
5+
use PHPUnit\Framework\TestCase;
6+
7+
class SipCallTest extends TestCase
8+
{
9+
public function testSipCallAttributes(): void
10+
{
11+
$sipCallData = [
12+
'id' => '1_MX4xMjM0NTY3OH4',
13+
'connectionId' => 'VGh1IEZlYiAyNyAwNDozODozMSBQU1QgMjAxNH4wLjI0NDgyMjI',
14+
'streamId' => '0123456789abcdef0123456789abcdef0123456789'
15+
];
16+
17+
$sipCall = new SipCall($sipCallData);
18+
19+
$this->assertEquals('1_MX4xMjM0NTY3OH4', $sipCall->id);
20+
$this->assertEquals('VGh1IEZlYiAyNyAwNDozODozMSBQU1QgMjAxNH4wLjI0NDgyMjI', $sipCall->connectionId);
21+
$this->assertEquals('0123456789abcdef0123456789abcdef0123456789', $sipCall->streamId);
22+
$this->assertNull($sipCall->observeForceMute);
23+
}
24+
}

tests/mock/v2/project/APIKEY/dial

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"id" : "1bae377f-d620-4e58-86c0-5a37364eec0c",
33
"connectionId" : "da9cb410-e29b-4c2d-ab9e-fe65bf83fcaf",
4-
"streamId" : "e6f13213-22cb-45de-b71d-af7cef329954",
5-
"observeForceMute" : false
4+
"streamId" : "e6f13213-22cb-45de-b71d-af7cef329954"
65
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"id" : "1bae377f-d620-4e58-86c0-5a37364eec0c",
33
"connectionId" : "da9cb410-e29b-4c2d-ab9e-fe65bf83fcaf",
4-
"streamId" : "e6f13213-22cb-45de-b71d-af7cef329954",
5-
"observeForceMute" : true
4+
"streamId" : "e6f13213-22cb-45de-b71d-af7cef329954"
65
}

0 commit comments

Comments
 (0)