Releases: MoceanAPI/mocean-sdk-php
Releases · MoceanAPI/mocean-sdk-php
v2.2.0
What's Changed
- add token as new authentication method by @koksianchong2 in #22
New Contributors
- @koksianchong2 made their first contribution in #22
Full Changelog: 2.1.1...2.2.0
Add Voice Feature
Example Usage:
use Mocean\Voice\Mc;
use Mocean\Voice\McBuilder;
$mcBuilder = mcBuilder::create()
->add(Mc::record())
->add(Mc::say('for english please press 1')) // tts
->add(Mc::collect('http://test.com/collect'))
->add(Mc::sleep(2000))
->add(Mc::dial('60123456789'))
->add(Mc::play('http://test.com/play'));
$mocean->voice()->call([
'mocean-to' => '60123456789',
'mocean-command' => $mcBuilder
]);Hangup Example:
$mocean->voice()->hangup('xxx-xxx-xxx-xxx'); //call-uuidRecording Exaple:
$recording = $mocean->voice()->recording('xxx-xxx-xxx-xxx'); //call-uuid
//save the file
file_put_contents($recording->getFilename(), $recording->getRecordingBuffer());