diff --git a/add-call.php b/add-call.php
index dbd69aa..8af1d80 100644
--- a/add-call.php
+++ b/add-call.php
@@ -1,12 +1,12 @@
getMessage() . "\n");
}
try {
- $db->exec("INSERT INTO calls (phone, schedule, xml) VALUES($phone, '$schedule', '$xml')");
+ $db->exec("INSERT INTO calls (phone, schedule, mp3) VALUES($phone, '$schedule', '$mp3')");
} catch(PDOException $e) {
die("PDOException (query): " . $e->getMessage() . "\n");
}
diff --git a/caller.php b/caller.php
index c945039..bdfe703 100644
--- a/caller.php
+++ b/caller.php
@@ -15,7 +15,7 @@ $client = new Services_Twilio(
$settings['twilio']['token']
);
-$result = $db->query('SELECT * FROM calls');
+$result = $db->query('SELECT id, schedule, phone FROM calls');
foreach($result as $row) {
$crontab->add_job(
@@ -25,7 +25,7 @@ foreach($result as $row) {
$call = $client->account->calls->create(
$settings['application']['from'],
$row['phone'],
- $row['xml']
+ $settings['application']['generator'] . '?id=' . $row['id']
);
})
);
diff --git a/create-table.php b/create-table.php
index 527839b..dc4d7fd 100644
--- a/create-table.php
+++ b/create-table.php
@@ -3,8 +3,9 @@
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec('create table calls (
- id integer PRIMARY KEY,
+ id integer PRIMARY KEY,
phone integer,
schedule varchar(50),
- xml varchar(255)
- );');
+ mp3 varchar(255)
+ );'
+ );
diff --git a/files/.gitinclude b/files/.gitinclude
new file mode 100644
index 0000000..e69de29
diff --git a/files/sample.xml.sample b/files/sample.xml.sample
deleted file mode 100644
index e677133..0000000
--- a/files/sample.xml.sample
+++ /dev/null
@@ -1,3 +0,0 @@
-
- http://www.atomaka.com/song-caller/golden-girls.mp3
-
\ No newline at end of file
diff --git a/xml-generator.php b/xml-generator.php
new file mode 100644
index 0000000..55237a0
--- /dev/null
+++ b/xml-generator.php
@@ -0,0 +1,20 @@
+setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+$result = $db->query("SELECT mp3 FROM calls WHERE id=$id LIMIT 1");
+
+$row = $result->fetch();
+
+header('Content-Type: text/xml');
+?>
+
+
+
\ No newline at end of file