rescue me - getting out of meetings using twilio
DESCRIPTION
Twilio is a cloud service for sending and receiving SMS, MMS and voice calls within your application. In this presentation I walked through building a simple service that would help you get out of meetings by sending a "rescue" text message at the right time.TRANSCRIPT
Rescue Me!Make your escape with Twilio
Robert Horvick
@bubbafat
Custom .NET Development and Training
How to get out of meetings
Escape
Freedom!
How wouldwe do that?
SMS
MMS
Voice
Enough TalkLet’s build something
public class EchoController : TwilioController{ [HttpPost] public ActionResult Index(SmsRequest message) { TwilioResponse response = new TwilioResponse(); response.Message(message.Body); return TwiML(response); }}
public class EchoController : TwilioController{ [HttpPost] public ActionResult Index(SmsRequest message) { TwilioResponse response = new TwilioResponse(); response.Message(message.Body); return TwiML(response); }}
public class EchoController : TwilioController{ [HttpPost] public ActionResult Index(SmsRequest message) { TwilioResponse response = new TwilioResponse(); response.Message(message.Body); return TwiML(response); }}
public class EchoController : TwilioController{ [HttpPost] public ActionResult Index(SmsRequest message) { TwilioResponse response = new TwilioResponse(); response.Message(message.Body); return TwiML(response); }}
public class EchoController : TwilioController{ [HttpPost] public ActionResult Index(SmsRequest message) { TwilioResponse response = new TwilioResponse(); response.Message(message.Body); return TwiML(response); }}
public class EchoController : TwilioController{ [HttpPost] public ActionResult Index(SmsRequest message) { TwilioResponse response = new TwilioResponse(); response.Message(message.Body); return TwiML(response); }}
TwiML?
<?xml version="1.0" encoding="utf-8"?><Response> <Message>The SMS Message!</Message></Response>
MVC
SMS POST
TwiMLSMS
MVC
SMS POST
TwiMLSMS
Try It!
Security?
Things We Know…
URL Path and Query String
POST Parameters
HTTP Headers
Things We Hope…
The request is from Twilio
X-Twilio-Signature
X-Twilio-Signature
URL Path and Query String
POST Parameters
HMAC-SHA1 (Auth Token)
Shhhh…Your authentication token is a secret.
ValidateRequestTwilio Authentication: The Easy Way
Why are we building APIs using MVC?
Web API
Nope!• MVC Only
• Derives from Controller
• ValidateRequest uses MVC Filters
Twilio.WebApi• Nuget Package
• Derives from ApiController
• ValidateRequest works
• MVC Code-Compatible
Web APIIt’s easier, right?
Sending MessagesIt’s even easier
Rescue Me!
Web Role
Web Role
Azure Service Bus Queue
Worker Role
Web Role
Azure Service Bus Queue
Worker Role
Rescue Me!Web, Worker and Stuff
919-261-3536