-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Twilio Calls API. Added Twilio API page.
- Loading branch information
1 parent
6aba229
commit fcb70c6
Showing
5 changed files
with
84 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | ||
<title>IoT HTTPS Relay</title> | ||
|
||
<!-- Bootstrap --> | ||
<link href="bootstrap-3.3.4-dist/css/bootstrap.min.css" rel="stylesheet"> | ||
|
||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | ||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> | ||
<!--[if lt IE 9]> | ||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | ||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | ||
<![endif]--> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>IoT HTTPS Relay</h1> | ||
<p> | ||
An API that acts as a relay for IoT devices that do not support HTTPS i.e. you can use HTTPS APIs using HTTP | ||
</p> | ||
<div class="alert alert-warning" role="alert"> | ||
<strong>Warning!</strong> Please be sure to understand the security issues of using this relay app and use at your own risk. | ||
</div> | ||
|
||
<p><a href="https://github.com/AllAboutEE/iot-https-relay">Fork me on GitHub</a></p> | ||
|
||
<h1 class="page-header">Twilio</h1> | ||
<p> | ||
<a href="https://www.twilio.com/">Twilio</a> is a voice and SMS(Text messaging) communication API. | ||
You can use this API to call and send textmessages to phones from your IoT devices. | ||
</p> | ||
|
||
<h4>Click on the links below to get started.</h4> | ||
<div class="list-group"> | ||
<a href="http://allaboutee.com/2015/03/24/esp8266-phone-calls-with-twilio-api/" class="list-group-item">ESP8266 SMS (NodeMcu)</a> | ||
<a href="http://allaboutee.com/2015/03/24/es8266-text-messages-with-twilio-and-nodemcu/" class="list-group-item">ESP8266 Calls (NodeMcu)</a> | ||
<a href="#arduino-sms" class="list-group-item">Arduino and ESP8266 SMS (work in progress)</a> | ||
<a href="http://allaboutee.com/2015/03/23/esp8266-and-arduino-phone-calls-with-twilio-api/" class="list-group-item">Arduino and ESP8266 Calls</a> | ||
</div> | ||
|
||
</div> | ||
|
||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | ||
<!-- Include all compiled plugins (below), or include individual files as needed --> | ||
<script src="bootstrap-3.3.4-dist/js/bootstrap.min.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
require('twilio-php/Services/Twilio.php'); | ||
|
||
$from = $_POST['From']; | ||
$to = $_POST['To']; | ||
$body = $_POST['Body']; | ||
$sid = $_POST['sid']; | ||
$token = $_POST['token']; | ||
|
||
$client = new Services_Twilio($sid,$token); | ||
|
||
$call = $client->account->calls->create( | ||
$from, | ||
$to, | ||
'http://twimlets.com/echo?Twiml=%3CResponse%3E%3CSay%3E'.urlencode($body).'%3C%2FSay%3E%3C%2FResponse%3E' | ||
|
||
); | ||
|
||
|
||
print $call->status; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
$body | ||
); | ||
|
||
print $message->sid; | ||
print $message->status; | ||
|
||
|
||
|