twilioKit php starter kit

I’ve adapted my ZFKit for an upcoming Twilio presentation (codestock next weekend!) and created a new project on github for it under the project name ‘twiliokit‘.  ZFKit was updated a little bit (a basic menu/navigation was added with Zend_Navigation, some example unit tests added) and used as the basis for this.

You can see this in action if you want to play around with it a bit.

I’ve modified the twilio REST client available from Twilio.com.  While functional, it wasn’t the easiest thing to use, and I’ve added a couple helper methods which may make things a bit easier for people.

I’ve got two examples so far – one is a basic ‘send SMS message to a phone’ controller, which uses my new helper methods in the Twilio_Rest_Client library.  The second is a small guessing game which demonstrates making use of ZF sessions.  You enter a phone number (and name!) to call, and the app will call up and ask the person to add two numbers together (“hello dave.  What is 4 + 2?”)  Based on your answer provided, you’re told whether you were correct or not, then offered a chance to play again.

I should have a few more examples before next weekend, but there’s actually quite a bit going on, between the ZF code and the Twilio code.  I’m working on something (in the code now) which will log all the call activity, and I’m working on it logging everything to a Doctrine table.

When you first use twiliokit, you’ll need to enter the ‘scripts’ directory and run the ./run script.  This will create the necessary ‘tcall’ table to store the info.  This is building from a schema.yml file to a local sqlite file.  You will probably need to chmod 777 the dev.db sqlite file, depending on your system’s permissions.

Oh, and there are a couple unit tests in place in the ./tests directory (though certainly not comprehensive).

This is definitely a work in progress, but I wanted to share it on github to allow people to use it and make any changes they need and be able to easily send those changes back to me.  I was on the fence about making this just a working branch on the zfkit project, but it felt like that might get too confusing.

Let me know what you think!


I'm currently working on a book for web freelancers, covering everything you need to know to get started or just get better. Want to stay updated? Sign up for my mailing list to get updates when the book is ready to be released!

Web Developer Freelancing Handbook

Share and Enjoy:
  • del.icio.us
  • DZone
  • Facebook
  • Reddit
  • StumbleUpon
  • Digg
  • Simpy
  • Technorati

{ 4 comments to read ... please submit one more! }

  1. All I see is this at the link given:
    Fatal error: Cannot redeclare Bootstrap::_initTwilio() in /home/zfkit/public_html/twilio/application/bootstrap.php on line 60

  2. Ack! Fixed – thanks!

  3. Hi Michael,

    I have been searching around the net for help on twilio conference functionality. From your blog post, it seems you might have some idea about this.

    I am trying to use twilio conference feature, but my requirement is to support approx 80 user at a time in a conference, whereas twilio officially supports only 40. Is there a way I can tweak this. May be create 2 conferences and join them somehow?

    Thanks
    Kamal

  4. I’m not sure there’s a way around that. You could try creating two conferences on two different numbers, and having one number connect out to the other, but I’m just not sure that would work. I was told that approach *should* work on tropo, but I’ve not tried it in either system yet. :/ Sorry.

{ 0 Pingbacks/Trackbacks }

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">



0.19524502754211