1
0
Fork 0

Initial commit with simple call example

This commit is contained in:
Andrew Tomaka 2013-02-24 14:16:57 -05:00
commit 09191ac270
5 changed files with 45 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
vendor/*
composer.lock
conf/*.yaml
files/*.mp3
files/*.xml

22
caller.php Normal file
View file

@ -0,0 +1,22 @@
<?php
require 'vendor/autoload.php';
require 'vendor/twilio/sdk/Services/Twilio.php';
use Symfony\Component\Yaml\Yaml;
$settings = Yaml::parse('conf/settings.yaml');
$client = new Services_Twilio(
$settings['twilio']['sid'],
$settings['twilio']['token']
);
try {
$call = $client->account->calls->create(
$settings['application']['from'],
$settings['application']['to'],
$settings['application']['xml']
);
} catch(Exception $e) {
echo 'Error: ' . $e->getMessage();
}

6
composer.json Normal file
View file

@ -0,0 +1,6 @@
{
"require": {
"twilio/sdk": "3.10.*",
"symfony/yaml": "2.1.*"
}
}

View file

@ -0,0 +1,9 @@
twilio:
sid: TWILIOKEY
token: SECRETTOKEN
application:
mp3: http://www.domain.com/song-caller/file.xml
to: 15555555555
from: 15555555555
time: 1800

3
files/sample.xml.sample Normal file
View file

@ -0,0 +1,3 @@
<Response>
<Play>http://www.atomaka.com/song-caller/golden-girls.mp3</Play>
</Response>