Sat, 20 Jun 2009

Update to The CIA Pickup Source

Since my blog post about it, there’s been a lot of interest in The CIA Pickup.  Thank you all for your emails and tweets, and big thanks to Twilio for featuring the application (with a video demonstration) on their blog, and “This Week On Channel 9” for doing the same!

I’m not sure how many people downloaded the code and played with it, but Erwyn van der Meer is one.  He made a few valuable contributions and suggestions, so I’m publishing a new version of the source code (at the same URL), with the following additions:

  • A global error handler in global.asax.cs that logs errors via Windows Azure logging.
  • A setting called SmtpPort in ServiceDefinition.csdef and ServiceConfiguration.cscfg, to support SMTP servers on different ports.
  • A comment in ServiceDefinition.csdef informing developers that they will need to add enableNativeCodeExecution="true" to the worker role definition if they use an SMTP port other than 25.
  • A setting called TwilioAccountSid in ServiceDefinition.csdef and ServiceConfiguration.cscfg to enable some simple validation that the calling entity is in fact Twilio (and corresponding validation code in TwilioController.cs).
  • HTML encoding of the callers in Calls.aspx to avoid cross-site scripting attacks (should the above validation not be sufficient).
  • A Python script called in the root of the project.  This script creates the necessary tables and queue in the cloud before you run the application (in the spirit of “Try to Create Tables Only Once”).

The new code is already live at  Please download the source again to pick up the changes, and keep the feedback coming!