• Posts

    Congratulations TechCrunch

    Congratulations to TechCrunch, who announced yesterday at TechCrunch Disrupt that they have been acquired by AOL.

    I’ve been reading TechCrunch since before I knew I was going to do startups.  It all started because my friend Blake Scholl was doing a startup, and I set up Google Reader to track TechCrunch so I would be sure to see when his company got coverage.  At the time I was working for a Fortune 1000 shipping company as a business analyst, and had nothing to do with startups.  I got addicted to reading the damn thing in the spring of 2007.

    TechCrunch is the reason I found out about Twitter, Twitter is the reason I came to understand social media, and there were a few hundred steps more before I landed here in San Francisco to work on Twilio.

    If you write in a paper journal, you might have noticed how the daily ritual becomes like a benchmark in your life.  In a way, it gives you deja vu — but in another way it helps you mark the passing of time.  Reading TechCrunch is like that for me.

    I’m happy to for Michael Arrington and the whole team there, and I hope they get some much needed rest and a chance to celebrate this weekend with their friends and family after TechCrunch disrupt wraps up.

  • Posts

    Experimenting with Google Scribe

    How would you like to have a program that helps you write blog posts faster?  With Google Scribe I can do just that.  In this post, I will use the suggestions from Google Scribe to generate some content about social media.

    Social media is finally about the media in the U.S. and Canada only and are not endorsed by or affiliated with Google in any way that suggests that they endorse you or your use of the Site and the related services or any portion thereof at any time and without notice to you and your family to enjoy a good meal and a drink for the first time in the future and the future of the world and the.  Recent reports about the growth of Twitter usage suggests that the two are not the only one who can not afford to pay for the cost of the project is to develop a new generation of protein database search programs and the latest news.

    Just like that, I’m writing semi-cogent sentences that are really just keyword spam.  If you’ve ever seen those types of strange SEO juiced blog posts you know what I mean.  Let’s try another angle.  I’m going to type 3 words, and accept the fourth that Google Scribe suggests.  No matter how bad it is, I’ll try to keep the sentences going.
    Social media is finally becoming a mainstream technology and this is the result of substantial increases in evangelism for the services like Twitter or AIM which are popular with people around the world.

    Okay, that wasn’t so bad.  Google Scribe event suggested “world” as the last word of the sentence before I typed it… and I was able to achieve the goal of the sentence (though the “or AIM” suggestion after Twitter was funny).  Let’s try the next sentence.
    Recent reports about the growth of Twitter has (why has, this isn’t proper English given the preceding text) have been used to suggest that social media is a mainstream tool for the businesses that want to build their brands.

    Meh, I got mostly “and” “or” “the” other useless suggestions.  Not sure why… or how I’d benefit from those suggestions.  It is fast when I am typing and Google Scribe suggests a word that I am not sure how to spell, like ridiculous which I see mispelled all the time.
  • Posts

    Startup Marketing: 2nd Class Citizen, 2nd Rate Results

    Wait… what?

    This quote from Steve Blank (which I realize is taken out of context, but such is the nature of Twitter, I’m not sure where he was speaking today) definitely rubs the marketer in me the wrong way.  Why would you ever want to exclude marketing and sales folks at your startup from the launch party (or any of your employees for that matter), as if they had no part in it?

    Treat Marketing as a 2nd Class Citizen, Get 2nd Rate Marketers

    My first reaction was to feel at bit nauseous about all the startup founders and employees who are influenced by Eric Ries and his popular Lean Startup methodology for product and market development, and probably read this tweet.  I feel like supporting this attitude encourages one of the most painful, costly, and damaging mistakes that was made at my last startup — and after thinking about it for a couple hours, I can’t not say something.

    This isn’t ultimately about Steve’s quote, or Eric’s support of it, which I see as symptoms of the problem. It’s something I’ve wanted to write about for a long time because I experienced it firsthand in my previous startup and it was very damaging to the product, culture, and IMO ultimately the company.

    This mentality of “developers before everyone else” is poisonous in startups, and it’s on the road to dangerous levels of hubris, and “pivoting”, or changing the direction of the business multiple times, due to a disconnected view of the world fueled by a Field of Dreams mentality (“if we build it they will come”).

    Here’s why…

    • Sales and marketing are helpful to have before launch, to make plans for achieving goals
    • The greatest insult to a great product, and the people who created it, is to market it poorly
    • To grow the business, cofounders need to trust marketing and sales to focus on things that the technical co-founders can’t or shouldn’t have to deal with on a daily basis
    • To make great early marketing and sales hires it had better be “our startup” together, in spirit not just in equity stake.
    • It’s not about the launch party, its about launching

    Order of Operations

    When a startup is founded, ideally the entire team is technical.  There is probably someone who is the most business-minded, but not a dedicated sales or marketing person.  If there is a non-technical member of the founding team, they’re probably (hopefully!) very deeply engaged in the product development aspect of the startup, and have earned the trust and respect of the engineer(s) co-founders.

    Depending on the product and other market conditions, it is possible that the founding team of engineers will launch without anyone in sales or marketing at all, and their developer design and active use of social media will help them spread the word.  This is exactly what happened with Twilio, which was launched in November 2008 without anyone whose entire job was to take the product to market.

    If the product offering is compelling enough, or the cofounders are particularly interesting to the community, getting a TechCrunch story will require little more than a thoughtful email to the writers and a slide deck on Slideshare.  This is the best case scenario, and in my opinion indicates a very well-rounded founding team with strong awareness of their market (business savvy) — even if their primary focus is building technology.  However, after that initial burst of attention and activity there are many questions to be answered that have a more to do with building a business than building a product — like how to continue to gain and retain customers.  This is where sales and marketing are helpful to have before launch, to make plans for achieving these goals.

    Getting Past Day Zero

    The launch of a new product is just the beginning of what will hopefully be a lasting and happy relationship with customers, press, analysts, and the marketplace in general.  It is a moment of inflection and incredible stress for the entire organization, whether it is three people, thirty people, or three thousand plus.  It is gloriously terrifying, and its something teams bond over.

    • There is no question that the vision and actual act of creating of the product is what makes it all possible, and that the people who build things that have never existed before are some of the most amazing human beings on Earth. The greatest insult to a great product, and the people who created it, is to market it poorly. This is the core of how I approach marketing.  Every day that I am spreading the word about Twilio, getting more people to signup, use, and pay for our product I’m honoring the ingenuity that created it, as well as the combination of intellect and execution that continues to make it better.

    A Matter of Trust and Focus

    When I interviewed I remember the exact moment I was sitting with Evan Cooke, CTO and one of three cofounders, and he offered me the opportunity to work at Twilio as their first hire.  I looked him in the eye and told him, “I can do this job, but we have to agree that marketing will never become a second class citizen to software development”.  I was actually afraid, for a moment, that I wouldn’t get the job but I told my husband later that I’d rather know right then what kind of company it was going to be than be miserable for the next year figuring it out.  That was 18 months ago, and I’ve never ever felt for a moment that there was a disconnect between the engineering team and the marketing team, which now includes a customer service manager and two developer evangelists, in addition to myself.

    One of the hardest lesson I’ve learned in business is that despite all my energy and intelligence, I can’t do everything by myself.  Talented people making tough judgement calls aren’t fungible, and in general human beings don’t scale very well unless we can find other people to help us achieve complex and long range goals.  The goal of a business is to organize a bunch of individuals to achieve a common goal, and properly celebrating achievements is a big part of keeping them organized.  Fortunately, if we recruit well we can come to trust marketing and sales to focus on things that the technical co-founders can’t or shouldn’t have to deal with on a daily basis.

    This initial division of labor within the startup seems to be a painful transition for technical cofounders — especially those who have never managed other people before.  It becomes even worse because the cofounders are managing people who are experts in something the cofounder might not understand very well like sales or marketing.  For the executive, it is harder for them to validate skills and expectations or pass judgement firsthand when they don’t have operating experience with a particular kind of role.  This is where building deep trust, and fostering an open culture where the sales or marketing person is responsible for sharing and educating about how they’re achieving their goals is important.  It’s also a strong case for objective metrics everyone can agree on, such as adoption numbers or revenue goals.

    “You Attract What You Are” – Warren Buffett

    I often read about developers who feel they’ve been made into lackeys by some MBA with an idea who wants the software engineer to “just code my startup”.  It’s written with so much disgust.  “How dare they undervalue what I bring to the table so much, or suggest that it’s their company and I’m just coding up the project?”  Followed by, “what kind of developer would ever sign up for something like that?”

    Flip this around for a moment.  Do you think good, honest, hardworking non-technical employees are going to join your company if you tell them they’re there to “just market my startup” or “just do customer service for my startup” or “just sell my product”?  To be good at any of those tasks, and especially to be the first person to say “I’ll follow you, take less salary, some equity that might not be worth anything, and work 24/7” you need to have ownership – it had better be our startup, in more than just an equity stake.  You better mean it, because these people will be the human embodiment of your brand.

    I love this quote from Warren Buffett, “you attract what you are” and I find myself reflecting on it often.  I haven’t fully tested this, but I’d be curious to hear if it holds true — does a culture where writing code is considered the most important productive activity in the company attract marketers and salespeople who think their job is the most important thing in the company?  Do people with a disconnected view of reality attract other people with an equally disconnected perspective?  My gut says yes, although I could use some more data.

    The corollary here is that if you are the kind of culture, or the kind of the founding technical team, that sees the launch of your first product as the groundwork for building a fully fledged successful business – you’ll attract early sales and marketing hires who want to be part of this long term vision.  Here are some things I’d suggest you look for in your first marketing hire.

    • wants to know how the product works
    • is endlessly curious, and isn’t afraid to ask a lot of questions
    • never has to be told the same thing twice
    • will stay up all night while the engineering team races to ship
    • is always thinking about how to simultaneously increase throughput and ROI, while decreasing operating expense (definition of “lean”)
    • loves customers obsessively, and doesn’t have a cynical bone in their body
    • knows when to be a bulldog
    • is humble – for example, they would clean the bathrooms when they can’t afford a janitor
    • understands the tradeoffs of time vs. money, and values both
    • someone who is a logical decision maker and isn’t afraid to argue for what’s right, or back down if it’s not worth the fight

    Great Marketer or Great Generalist?

    You might have heard the adage “every startup needs a great generalist”.  I’m not sure where it comes from, but it makes a lot of sense to me.  Some of the hats I wore early on at Twilio to remove workload from the engineering team included: customer service department, recruiter, office manager, shipping/receiving, project manager, sales rep, product tester, PR agent, etc.  That was so insanely fun, and we eventually hired people to take over these roles, but early-on it served two major purposes:

    1. run the company like a real business, achieving strategic goals
    2. make the dollars spent on non-engineering labor worth every penny, and more

    The Company That Launches Together, Stays Together

    To get back to the original comments that inspired this post, it’s not about the launch party, it’s about launching.

    Your launch party is for show, usually to bring attention to your new product and group together all your well-wishers and potential customers so you can say, “ta da!”  It’s a branding thing, and very different from that moment at 3am where you crack open a $4.99 bottle of sparkling wine you bought at Trader Joe’s and say to the team, “we’re live”.  Or that moment at 2am where you find a member of your customer service pouring over every last detail of the freshly written FAQ.  Or that moment at 11pm where you merge in your latest changes and your sales guy offers to run out and get pizza because the engineering team is starving but has hit on some nasty conflicts.

    These aren’t the most important tasks, but they make launch just a little easier and they keep us human and connected through the exhaustion and struggle to build great products and companies.  They do honor to the people and products that make startups possible.

    Practice Makes Perfect

    I didn’t start out my career as a marketer, and I’m sure I don’t have it all figured out, but I can tell you how I try to live by this at the startup I’m working on today.

    At Twilio we have a culture where everyone contributes to customer service and the majority of developers attend marketing outreach events, speak at conferences, create marketing materials like screencasts or how-to content for our website.  When we hire people for non-engineering roles, we require them to write a basic application using our API.  With regard to sales, we take pride in making money, and openly share our revenue numbers and balance sheet with the entire team at our weekly all hands, and celebrate big sales wins together.  We’re hiring.

  • Posts

    TweetToCall is Becoming a More Social Phone Book

    My beloved side project TweetToCall recently turned one year old, and I’ve been procrastinating on re-styling it to look more like a Web 2.0 service and less like a weekend project.  This post on TechCrunch tonight about the death of phone numbers motivated me to give it an hour of my time while playing Mario Cart with Kevin and digesting an awesome steak dinner I made for us.  Because really, when else can I justify working on a side project these days?

    The Changelog (Sort of)

    I had updated the main page with this lovely style inspired by a cool piece of graphic art I bought on iStockPhoto, but still needed to refresh everything else.  Tonight I went through and tested everything again to make sure it is all working.  The signup process, phone number validation and listing of TweetToCall enabled friends have been reviewed end-to-end and I’m happy to report the code has aged nicely.  I think we might be doing some inefficient things with API requests to Twitter on certain commonly reloaded pages (really need pagination for those users who are developing a bigger phone book), but that won’t impact the majority of users at this point.  Definitely on the list though, since it drives me nuts when I’m testing.

    As for the design update, all I have to say is CSS is amazing (there is knowing this and really KNOWING IT, I’m feeling the latter)… the time savings on this update after the previous were minimal.  I updated the header, deleted a couple divs, and bam.  While it’s still ugly (hey, I’m not a designer) it is a lot less offensive than before.

    TweetToCall.com Website Refresh

    Other Improvement Plans

    I’ve talked a lot about adding Facebook Connect as the next integrated social network, and now I’m thinking Firefox/Chrome plugins could be cool as well.  Ultimately, I think I will probably move this all over to DialSocial.com where it will be much less Twitter centric.   Other than a few media mentions from back when Jajah launched their @call feature almost a year ago, I don’t think I’ve accumulated much brand value, and having the Twitter account suspended endlessly makes it even easer to abandon the TweetToCall brand.

    Another thing on my list is to get @tweettocall unbanned on Twitter, it has been stuck in that state for over a year now and I haven’t been able to get any responses to my support requests (this happened when my own Twitter account @daniellemorrill and @twilio got banned in a widespread block to try to control some malicious spam during the Gov 2.0 Summit in D.C.).

    Why It’s Just a Side Project

    Beyond the fact that I am super happily employed at Twilio (the voice API platform TweetToCall is built on), I just feel like there’s no point in really building this out and pumping a bunch of money into marketing it.  There is a big barrier to getting users to sign up – getting them to give their phone numbers.  Twitter, and to a lesser extent Facebook, have all their users and this is really just a feature they could easily implement.  The one way I might be able to make it more valuable is to have more networks that you can hook into from a single place — but for now it just feels like a feature, not a full product and certainly not a company.  If you feel differently, please let me know I’d love to hear your thoughts.

  • Posts

    Tons of Stubs, But No Posts

    I’ve been writing a lot of starts to posts these past two weeks – but nothing that feels fit to publish (yet).  Here’s a teaser of some of the topcis I’ve been mulling over, I’d be curious to hear which of these (if any) interest you:

    • Startup Stuff No One Seems To Talk About — based on a trend I’ve noticed in my conversations with other entrepreneurs about the “unmentionable” elements of entrepreneurship that no one really brings up
    • Twilio Quickstart with Ruby on Rails — port of the Twilio quickstart application from PHP to Ruby on Rails
    • Understanding the Value of MVC Architecture — yep, writing it as I come to really understand it, so far the key point is the huge increase in efficacy
    • Living Intentionally — stuff about career plans, goals, and some reflection on goals I set for 25 (which I turned in April)
    • If I Were An Angel Investor (Part 1) — a list of early-stage startups I think are really interesting, and might be killer investments
    • No Room for Tall Poppies — response to story I read via Hacker News about anti-intellectual culture of hiring
    • Thoughts on Inception — movie review, thinking I will need to see it again (smart producers!)
    • U.S. Government Requirement for 1099s to Stifle Small Business — activism post
    • Finding Your Own Everyday Entrepreneur — seeing the scrappy awesomeness of everyday choices
    • We Live in Public? — thoughts on Facebook, public/private life online and off, etc. — thinking this won’t go out until the Facebook movie hits theaters
  • Posts

    Objectivism: Simple Tactics to Get Started with Online Activism

    Today we heard an excellent talk from Yaron Brook about the importance of defending capitalism, and he ended his speech with a rousing call to action for the audience.  “I’m willing to put it all on the line, are you?”

    People stood and clapped, but I left the room wondering whether they realize this isn’t just something that a small set of us need to do. Activism, in small and large ways, is something all of us can help with.  As much as I wish there were enough people who held the right ideas where I could hide behind “division of labor” as my argument, and just go on building businesses and being productive, here is the harsh reality: if you want to see the world change in your lifetime, you have to live in the future today.

    In the most basic terms: it’s time for each of us to do SOMETHING.  I’ve been relaxing at the pool today with Trey Givens, Earl Parson, and Mark Wickens and I asked them to help me brainstorm some ways you can get involved.  If you’ve been helping advocate Objectivism for awhile, this might seem self-evident but please take a look and see if there is anything here you can add to your own playbook.

    Activism in…

    5 Minutes

    • vote up news stories and bog posts you like on Digg.com
    • add Objectivism and/or capitalism to your online profiles (Facebook, Twitter, LinkedIN, etc.)
    • republish content that you think is good (e.g. link to an ARI op-ed from your Facebook back)
    • make yourself or your car a moving billboard for Objectivism (with a shirt, bumper stickets, etc.)
    • check out out the free articles on The Objective Standard (or subscribe!) and follow them on Twitter

    10 Minutes

    • comment on items posted on Facebook, blog posts, etc. – encourage people to keep blogging
    • donate money to ARI
    • contact ARI about donating money to buy books for your local high school campus club
    • comment on items posted on Facebook, blog posts, etc. – encourage people to keep blogging
    • comment on news stories, or even blog a full response to a news story

    30 Minutes

    • subscribe to other blogs that forward ideas you agree with
    • call into radio shows, or television shows (or at least email them)
    • write a letter to the editor
    • write a letter to local or national government etc.

    More Time & Other Ideas

    • distribute the Undercurrent to your local schools
    • share your values with non-Objectivists — for example, art at the Cordair Gallery (not just Atlas Shrugged, the Fountainhead)
    • start your own blog (lot’s of good free platforms out there)
    • donate money to the Undercurrent, to your local campus club
    • join local organizers that you’re interested in, and influence the outcomes of their decisions
    • telling stories about your own success or people that you know – about how Objectivism has helped you
    • meet up with people in real life to reinforce your ideas, sharing your values, finding people you can relate to, learning new things
    • join groups like Toastmasters, where you can speak about your ideas to a captive audience

    More check out post from Burgess Laughlin about “in-line activism” -about being an activist within your profession

  • Advice,  Objectivism

    Tips for Asking Good Questions After a Lecture at OCON

    One great aspect of Objectivist Conferences is the opportunity to ask questions of the intellectuals presenting their ideas, immediately following their talks.  Coming up with a thoughtful question can add depth to the topic, and help express misunderstandings that might be shared by a lot of the attendees listening.  However, Q&A sessions have a limited amount of time, so if you’re going to take it up with your question you might as well do a good job.  I personally find it pretty intimidating to get up and ask a question in front of the large audience, however I can tell you a lot from an audience perspective.

    Write Down Your Question and Read It Aloud

    The time to think up your question is not when the microphone is before your lips.  Not having a clearly formulated question can lead to a lot of those “ummm”… “ahhh” moments, which most of us strive to avoid.

    I’m not saying that I think most attendees do this, but if you’re reworking your most eloquent presentation until the final moments before its your turn often your question comes off as made up on the spot.  Think about how much time the speaker spent crafting their talk, structuring it to keep you engaged and to help you inductively come to conclusions.  If you take this same care for your own questions, I think you’ll find it is rewarding to have a speaker say, “that’s a great questions, here’s what I think…” instead of “wait, I’m not following?”

    A Declarative Statement is Not a Question

    Questions should start with words like “who”, “what”, “where”, “when” and “how”.  Why, you ask, is this important?  A declarative statement preceding the actual question has a bunch of usability issues for the person being asked:

    Unpacking Incorrect Premises

    If a declarative statement is made and the speaker doesn’t agree, he’ll feel responsible for responding first to any errors in that statement, before even getting to the question.  This can distract from the actual question if it takes longer than 15-20 seconds to deal with, and leaves a lot of speakers asking, “what was the question again?”

    Wasting the Audience’s Time

    Yes, you probably are a pretty smart cookie but the Q&A session is not the time to show off.  Your question really should only require a sentence to express, which is another reason why writing it down is a good idea.  Helping the speaker to expand on a particular part of their talk, or bringing to light a perspective that can add depth is the goal – not making a speech about what you think is right.  People didn’t pay to hear you talk, if you want them to then consider offering your own speech (elsewhere).

    Get Up There and Ask

    Finally, I want to encourage anyone reading this to just get up there and do it.  It might not be perfect, but I think if you try to follow this advice it will help you put a bit more thought into your question, and that can’t hurt.  Remember, conferences are generally benevolent places where people are learning together – so the best thing we can do as attendees, staff, speakers, and those asking questions is help each other become better at understanding the concepts being presented.

    Looking forward to many good questions in the coming days!  These are just my initial thoughts, I’d love to hear what you think makes for a great question following a lecture in the comments.

  • Posts,  Travel

    What the Heck is This #OCON Thing?

    I’m going to be tweeting a bunch about something with the hashtag #OCON, and I know a lot of people are going to ask me what it is.  #OCON stands for Objectivist Summer Conference, and this year’s event is taking place at Red Rock Resort & Casino, about 30 minutes off of the Las Vegas strip.

    One of my less public, but very personally significant, interests is philosophy — and I’m particularly interested in the philosophy Objectivism, which was created by the late Ayn Rand.  You might remember her, she wrote the novels The Fountainhead and Atlas Shrugged, which are required reading in a lot schools.

    I’ll be sharing my thoughts on the conference, the ideas discussed there, and other goodness tomorrow through July 10th.  I hope you’ll find some of it interesting, and I’d love to hear your thoughts.

  • Code

    How I Built a Multi-User Door Buzzer for Our Apartment

    Full disclosure: a lot of people have talked about this idea, this is just my implementation of it for our apartment.  You can check out Buzzeromatic.com if you want someone else to administer yours or post to Elance/oDesk/HackerNews/Twitter to get someone to build it for you.  Look for something cool from @gregkoberger with all those features I left out (user management, UI, adding new roomies, adding more numbers etc.)

    Making a Present for My Roommates

    About a month ago, I moved to a 3-story loft in SOMA with my husband Kevin and our good friends Park and Kat.  My sister also graduated college and joined a local startup, so she’ll be moving in with us next week.  With 5 people living here and only 2 master keys to the front door, we had a bit of an access problem right away.  My roommates, knowing I haven’t had a chance to code since the move started, were nice enough to suggest a build an app with my Twilio skills (full disclosure: I work there) and we tested it out last night – it works, so I’d love to share.

    How A Call Box Works

    If you’ve lived in an apartment with a call box for buzzing people into your apartment before, this will sound pretty familiar.  There is a list of names and corresponding codes listed on the callbox display, you dial the number and it rings the person who lives there, they press a key and the door is unlocked.

    What happens inside the callbox is a little more interesting – because the sound the keypress makes, which is called a DTMF tone, is actually a pretty amazing little thing.  Tone dialing was arguably one of the earliest massive implementations of human-to-computer communication.

    Phreaking Out the Phone with DTMF Tones

    There is a long history of phreaking (the image to the right is of a bluebox built by Steve Jobs and Steve Wozniak, on display at the Computer History Museum) by playing DTMF tones and other tones (pulses, pins, etc), and the things telecommunications hackers achieved without any kind of API like Twilio is pretty amazing.  In my case, the call box just requires the person who receives the call to press 6 to open the door, and responds when the 6 DTMF tone is played.  This tone doesn’t have to come from pressing a key though,  I can just play the audio file into the phone to mimic the action of a keypress – and the doors opens!

    The simplest implementation of this is just to have the door automatically open when anyone dials your extension.  I don’t recommend setting your callbox up this way, because you might accidentally let in people who are messing with the box looking for a way in so they can do bad things.  My street has a lot of bums and other riff-raff on it, so I wanted something with a couple different types of security.  So here’s what I did.

    Setting Up My Call Box with Twilio

    If you haven’t heard of my company, Twilio, before the really quick elevator pitch is that we are the AWS of telecommunications, making it easy to send/receive calls and text messages programmatically and only paying for what you use.  It’s pretty sweet, its a startup, and I’d love your feedback on it.  So here we go:

    • Get a local Twilio number (or you can use the sandbox number for free)
    • Tell your building administrator to add your name/number to the box
    • Build a simple app that forwards the call to your cell phone so you can make sure the box can recognize DTMF tones passed from a forwarded call

    Doing this test before you build your full blown app is really important, it will save you from debugging an issue outside of your control.  You just need to create this little callbox.xml file, save it somewhere on the web (publicly accessible on Dropbox is a handy option, our try Twimlets)

    callbox.xml (replace 415-555-1212 with an actual phone number)

    1. <Response>
    2. <Dial>415-555-1212</Dial>

    3. </Response>

If you are using your Twilio trial account, make sure you use the Twilio sandbox number and remember your pin code for testing (or email me at danielle@twilio.com and I can manually remove this restriction from your account). If you run into problems just email help@twilio.com for 24/7 support, or tweet @twilio

Building the Full App

Now that your testing is done, it’s time to build the full app with just a little PHP.  This took me about 25 minutes to write from scratch in Emacs, probably will take you a whole lot less with all the sample code.  Here’s the spec for how the app should work:

Need to have:

  • visitor or roommate dials our extension in the call box and our Twilio number is called
  • menu is read to visitors, giving them the option of which roommate to contact
  • roommates have a secret code they can punch in to bypass the menu and open the door
  • if the visitor selects one of the roommates from the menu options, that roommate gets a call and presses a number on their cellphone dialpad to buzz in

Nice to have:

  • menu selections can be made at anytime, without waiting for the menu to finish, because that is just annoying
  • roommates can be simultaneously dialed on multiple numbers (cellphone, work, house phone) if they want
  • fun audio files can be played when someone is let in

callbox.php – this file controls what happens when the callbox is dialed

–>

  1. <?php
  2. header(“content-type: text/xml”);
  3. echo “<?xml version=\”1.0\” encoding=\”UTF-8\”?>\n;
  4. ?>
  5. <Response>
  6. <Gather action=”/doorbell_gather.php” method=”POST”>
  7. <Say voice=”woman”>If you are here for Katrina, press 2.</Say>
  8. <Say voice=”woman”>For Danielle, press 3.</Say>
  9. <Say voice=”woman”>For Park, press 4.</Say>
  10. <Say voice=”woman”>For Kevin, press 5.</Say>
  11. </Gather>
  12. </Response>

Two important things to point out here. First, notice that the menu options in the tag are nested within . This is awesome, because it means Twilio is listening for a keypress the entire time and you can interrupt the menu with your selection at anytime. Also, you’ll see if you check out the Twilio example code that usually includes the numDigits parameter, but we’re excluding it on purpose here because we want to accept secret pin codes in addition to single digit selections. You’ll see why in a moment.

doorbell_gather.php – this file determines what to do with the keypad data we just received

Note on this code: There are definitely more elegant ways to write this, but in my mission to convert all my roommates to geeks I’ve opted for something they can easily understand in case they want to change their secret codes without my help.  All pincodes have been changed for this example.

–>

  1. <?php
  2. if($_REQUEST[‘Digits’] == ‘2’) {
  3. header(“Location: katrina.xml”);
  4. }
  5. if($_REQUEST[‘Digits’] == ‘3’) {
  6. header(“Location: danielle.xml”);
  7. }
  8. if($_REQUEST[‘Digits’] == ‘4’) {
  9. header(“Location: park.xml”);
  10. }
  11. if($_REQUEST[‘Digits’] == ‘5’) {
  12. header(“Location: kevin.xml”);
  13. }
  14. if($_REQUEST[‘Digits’] == ‘1234’) {
  15. header(“Location: secret-danielle.xml”);
  16. }
  17. if($_REQUEST[‘Digits’] == ‘6677’) {
  18. header(“Location: secret-park.xml”);
  19. }
  20. if($_REQUEST[‘Digits’] == ‘9988’) {
  21. header(“Location: secret-kevin.xml”);
  22. }
  23. if($_REQUEST[‘Digits’] == ‘6786’) {
  24. header(“Location: secret-katrina.xml”);
  25. }
  26. header(“content-type: text/xml”);
  27. echo “<?xml version=\”1.0\” encoding=\”UTF-8\”?>\n;
  28. ?>
  29. <Response>
  30. <Say>I’m sorry, but the person you attempted to reach is unavailable.  Please try again later.</Say>
  31. </Response>

So Twilio is passing the keypress data as ‘Digits’ and we’re telling Twilio where to go depending on what was pressed. Pretty simple. The little bit of TwiML at the bottom only plays if the roommate called doesn’t answer their phone.

So now we need to create:

  • roommate.xml – which calls the selected roommate so they can buzz in their guest
  • secret-roommate.xml – which automatically opens the door when the code is entered

You might be wondering why everyone has their own secret-roommate.xml file, when they all do the same thing.  I decided it would be fun to prank my roommates with a funny theme song or movie quote before the door would unlock…

To complete this code, you’ll need to get an audio file (.wav or .mp3) of the DTMF tone you want to play back to the machine.  I used this awesome DTMF generator, and they host the audio file for you.

roommate.xml – the file that calls the selected roommate

  1. <Response>
  2. <Say>Connecting you to [Roommate’s Name] now</Say>
  3. <Dial>415-555-1212</Dial>
  4. </Response>

secret-roommate.xml – the file that opens the door is the roommate enters the correct pin code. The first <Play> contains a fun audio clip from Back to the Future, the second one plays the DTMF tone that will open the door (make sure to change this depending on which tone will open your specific door).

  1. <Response>
  2. <Play>http://moviewavs.com/0059305935/WAVS/Movies/Back_To_The_Future/seriousBLEEP.wav</Play>
  3. <Play>http://www.dialabc.com/i/cache/dtmfgen/wavpcm8.300/6.wav</Play>
  4. </Response>

So there you go, now you can manage a callbox for a bunch of roommates, add secret pin codes, and even give selective access to delivery people, cleaning staff, or whoever else is coming by to visit. Let me know if you find any bugs or have ideas for how to make this cooler in the comments.

Photo credits:

  • Call box: http://www.flickr.com/photos/carol329/300231462/
  • Touch Tone Telephones, 1966: http://www.flickr.com/photos/roadsidepictures/3601261522/
  • Bluebox: http://www.flickr.com/photos/awarnack/110798864/