Category / Tech Stuff

Why I Love Git (or Git vs. Subversion) July 26, 2010 at 11:55 pm

I have used Git before but only in small trials. Due to the ancient servers I was previously interacting with, I was unable to upgrade from SVN to Git. However, some recent changes have finally allowed for this.

I will never go back.

First off, I must say that there is not one thing I could do in SVN that I can’t do in Git. And to be fair, there are very few things that Git can do that SVN can not. Every branch, commit, tag and other feature in SVN seems to be available in Git and vice versa. But Git provides some secret sauce on top that has changed my life forever.

Branching as a Way of Life

Branches, tags and managing those particular intricacies of release management used to be cumbersome. Everyone had their own way of doing it. Helper scripts were available for SVN (like svnmerge) that would track your commits and work and help make friendly merges across branches. But they all were a bit cryptic and hackish – usually requiring separate downloading of some script and some secret command lines and such. Generally, it was a pain. And it was slow and, sometimes, insecure.

Git makes branching incredibly simple. INCREDIBLY simple.

If you want to create a branch, you make sure you are checked out in whatever you are branching, and then you just type:

git checkout -b new-branch-name

All done. To keep life organized, you can make up your own fun branch name with versions. We use modulename/1.x to designate a module/feature and a version. Easy.

Switching branches is just as easy. Same command as above, but without the -b. Sweet. Git will automatically switch to the other branch, assuming you haven’t changed any files in the current branch. If you have, it will politely list which files and ask you to fix the problem – with lots of verbose instructions. Yum.

But here’s what’s really nuts… Because this is so easy, I actually find myself using git’s branch feature more regularly. Like, every 30 minutes or so. Working on open-source projects makes you a bit ADD – people are chatting all day with suggestions, features, bugs and some are quick to implement, but you have to be able to hop around – quickly. I would never dream of tracking things like I am using SVN. It would take hours.

Committing Locally

Committing locally has changed my life as well. We used to commit a lot of broken code to the repository. We’d do this because, mid-stream down an idea, we sometimes thought “gee, we should do this differently.” But in case the “differently” way didn’t work, we wanted a way to “go back”. Or sometimes we’d want to share what we’d done so far with a teammate. This was hard to do when it was constantly coupled with merging and branching. We could be doing this 20 times a day, being that our contributors and programmers are spread across the US. Nobody can “run over to my screen” to look through things. And since we use IDEs to program in, screen sharing wasn’t an option.

Git’s ability to allow you to commit locally or off a private shared repo before pushing to a public repository has, again, been so unbelievably easy, you sort-of have to be brain dead not to get it. And it’s, again, changed our workflow. We regularly commit our work now – tracking each individual change – and we revert more often, which saves us time when we make mistakes. Before we’d just have “code we deleted.” Now it’s all tracked.

Infrastructure Be Gone!

In addition, setting up SVN with more strict access controls and to use Apache with any sort of security required usually required loading mod_subversion and some other funky stuff in Apache. Annoying. Git, however, uses SSH. There are WAY MORE tools for SSH key management and it’s inherently secure without any loaded modules on the server. We’re using gitolite so we can go even further, but even that isn’t required. Stupidly simple AGAIN.

Oh, and all this branching stuff – WAY fast on Git. Local commits and creations of branches is near instant, even on a large project. Only when we’re ready to be “finished” and have to pull or push changesets to the server do we see any delays.

Not All Roses

Subversion is still the defacto in many places – and it shows. Our IDE doesn’t support Git yet. Many features Git has aren’t exposed in our hosting provider’s interface (assembla) such as submodules. And we do find some features (such as submodules) complex.

We’re still learning.

That said, I’ll never look back. Git is an amazing upgrade to an already amazing version control world we live in. Three cheers.

Read More On Git:

Ten Git Tips & Tricks for Beginners

Gitolite (from Pro Git)

Managing Multiple Git Clients

FreeSWITCH gets a free GUI (and a paid PBX platform) August 5, 2009 at 8:07 pm


Update: The FreeSWITCH GUI project that temporarily became the FreePBX v3 project is now actively maintained as the 2600hz Project.

What happened to TCAPI and the FreeSWITH GUI project?

I’m pleased to announce the general availability of the developers release of FreePBX v3.0. I designed the code, along with the help and feedback of the folks at, from the ground up –¬†starting with my TCAPI project which has now merged with FreePBX. This work is the result of years of experience with telephony systems. Specifically, the last two years have included tireless development and effort coding late into the night and through the weekend to produce a flexible, modular PBX system that was open-source.

Finally, that PBX software gets to see the day of light. Thanks to backing from and the FreePBX project, you can now see the documentation and code I’ve been working on at .

I also strongly recommend you checkout – a hosted service that is beginning to offer free sandbox development installations for learning and utilizing the new FreePBX v3.0. is run by one of the core supporters and developers of the FreePBX v3 open source community, Michael Phillips. The site also offers hosted virtualized instances of FreePBX that work great and cost almost nothing.

Speaking of core developers, we would be nowhere without the help of Karl Anderson. Karl is a more recent addition to the team but he’s committed so much code he might as well have been here since day 1. Karl is part of the team, and there’s no doubt in my mind that FreePBX v3.0 will make it into the service offering of Karl’s company thanks to his efforts. If you need hosted VoIP with a premise-based service contract, check out Kudos to Karl for his awesome work.

So what’s in FreePBX v3.0? Here’s just a short list:

  • A solid MVC framework design
  • CRUD for device management, number management, IVR management, voicemail, user management, etc.
  • Central number database, to avoid conflicting dialplans
  • Pluggable, modular architecture¬†– tailor the product to do what you want
  • Tie-ins to the FreeSWITCH architecture, including the ability to monitor sofia registrations and turn on/off message waiting lights via web-based voicemail
  • Internationalization support
  • jQuery/AJAX based grid and navigation systems
  • Completely skinnable CSS & layout system – put your brand or vendor logo on the pages, or redo it completely!
  • Automated installer
  • Module management system via the web
  • Advanced hook and event system in both the database driver and the rendering system
  • Ability to send SMS text messages from the UI
  • Ability to make phone calls from the UI
  • Play voicemails via the web
  • XML/Curl support as well as static config file generation
  • The start of an Asterisk driver

For those of you who were interested in TCAPI, I hope you will join me in the move to the FreePBX name and a newer codebase. The concepts of TCAPI (and ironically of the original AMP) are being revived and refined in the new FreePBX v3. Feel free to join us on in #freepbx-dev to tag along for the ride.

I’ll be demoing the new FreePBX v3.0 today at ClueCon (in just a few minutes actually). I’ll post the video as well, once it’s ready. In addition, it’s worth noting that the FreeSWITCH team just announced their first corporate sponsorship and paid product. So now you have the option of a fully supported PBX system made by the developers of the core FreeSWITCH project.

And let the games begin…!

Announcing mod_nibblebill – a FreeSWITCH module that does billing! January 15, 2009 at 12:30 pm

I am pleased to announce the submission of mod_nibblebill for review and hopefully acceptance into the trunk of the FreeSWITCH project.

OK, it’s rev. 1 and needs a bunch of work. Got it. But it’s very functional and it does infact function!

Take a peak at the extension documentation I wrote up on their WIKI for details. The module basically handles real-time billing for lots of simultaneous calls in a way where you can give people credit that they use up and their calls get terminated when they have no more money.

Soooo many uses for this!

Let me know if you have questions, as usual! Drop me an email

Adventures with XML and YUI and Dojo January 13, 2009 at 3:32 pm

Grids, grids, grids – everyone wants to make a cool grid rendering engine. Both YUI and Dojo seem to include out-of-the-box functionality to make a cool datagrid that’s similar to, dare I say it, .NET’s built-in grid rendering engine. But cooler, of course, and in JavaScript.

I love the grids they’ve come up with – specifically Dojo’s, where they’ve actually managed to render only the portions of the grid you are viewing until you scroll elsewhere. This makes it reasonable to support grids with rather large sets of data and save on rendering time until you need to render an area. Cool stuff.

What I’m not impressed with is how inflexible the inbound datasets are to these grids. Not a one seems to believe in complex XML anymore – all the cool kids now seem to be using JSON. Which is great if you’re writing your application from scratch and have that much control. But if you don’t, you’re sort of screwed. The XML parsing engines as they relate to datastores which can be used in grids are basically non-existant in both YUI and XML unless you have a very flat XML structure. Neither framework will go deeper then a single element without overriding the default data stores or writing your own parsing tool (for which you won’t find any directions on how to do).

It boggles my mind that XML, in particular, has such poor support when the browser itself provides such great support for XML as a data type. Aside from the obvious parsing functions required natively to parse HTML, you have XPath, XQuery and the DOMNode/DOMDocument structure itself built-in to every single browser out there. Why not adapt this data structure to work with these DataGrids using some of these available tools? It seems completely reasonable to me to allow for an XPath query to find certain nodes in a dataset and make them into your datagrid – and because we’re just talking about DOMNodes being returned you can still retain the cool functionality of editing and what not. And of course, you can pass all this good stuff back to any XHR command you wish in it’s native form.

So I guess I’m making the case for more formats (especially XML) to work with datasets inside DataGrid’s. I can only hope we’re not all force-fed JSON, because it’s not quite there yet when it comes to a reliable, expected output option from every app we may want to interact with. Sometimes we are writing a UI for a back-end that’s already been written and just needs an overhaul. Not all of us get to write something brand new and sparkling in Ruby with JSON support.

Here’s to hoping…

Ruby modules are awesome January 12, 2009 at 5:00 am

If you read my previous blog, well. I told you this was a roller coaster! I’m starting to feel manic.

Ruby, on the other hand, is pretty solid, well documented, and cool.

After fighting with stupid gems all day, I decided to just let people include their own with a simple wrapper. So I started playing with modules.

Modules really rock. They are so freakin simple it’s unbelievable. Modules are sort of like namespaces but you can build upon already loaded ones. Basically, what this means to me is that I can have a base/core module that loads all the files in some module directory, and then figures out dynamically what’s been loaded.

Here’s a practical example (from the previous blog).

Let’s say we want to be able to let a system administrator installing our software decide where users authenticate from. The avilable options *we* thought of were Active Directory, Local Database and Linux PAM. But the reality is not everyone will need all of these options, but someone might need two of them (like local DB and active directory – such that when A.D. is down you can still get into your machine). How do we do this?

First, the individual modules would look something like this:

module MyAuthFramework
  module AuthViaLDAP
    def Login
    # Do login validation here, possibly through a gem

You’d save that to a folder somewhere, along with maybe another module, like this:

module MyAuthFramework
  module AuthViaPAM
    def Login
    # Do login validation here, possibly through a gem

Note that the two modules share the same method name and base module, but the module namespace in the middle is different. Loading both the above files from the same Ruby script effectively mixes them together, creating this:

module MyAuthFramework
  module AuthViaPAM
    def Login
    # Do login validation here, possibly through a gem

  module AuthViaLDAP
    def Login
    # Do login validation here, possibly through a gem

Now, in a base file somewhere, we can use a nifty constants method built into modules to accurately see what’s loaded and cycle through each class, calling it’s login function with some credentials we received. Whoever returns a success could be declared the winner!

module MyAuthFramework
  def Login
    MyAuthFramework.constants.each do |modulename|   # Cycle through all modules
      mod = Object.const_get(modulename)                    # Instantiate the module
      mod.Login()    # Call the method in each module

This routine will effectively call the Login() methods in both the included modules, LDAP and PAM.

cool, huh?

Check out the docs for more goodness.

Why Ruby on Rails frustrates me… January 11, 2009 at 11:00 pm

So I am now in week 4 of trying to switch to Ruby on Rails from CakePHP. It is truly a roller coaster ride.

On the upside, I have been very, very impressed with the true object-oriented nature of Ruby. Really, I can’t say enough here. The fact that you can override and extend pretty much anything in the language to your liking is just awesome. Everything is an object – just like Java or Javascript – but without the annoyances of an overwhelming required number of definitions or memory concerns. You can even overload symbols and other operators. The built-in introspection and modularity is just slick.

On the downside, I am continuing to have trouble taking advantage of this “goodness” so many speak of with Rails. I don’t think it’s because of lack of trying. I think it’s due to lack of good documentation.

As a practical example, let’s say I want to do something as simple as create a login generator that can integrate with LDAP as well as a local database. This is a practical scenario I’ve run into in the PHP world – I want to have Windows users use the same login/password on an intranet site as they do for their Windows credentials. But I also want a fallback mechanism so I can login when LDAP is broken, or when I need to create a special account for, say, a contractor who only needs temporary access and should not be allowed onto the Active Directory network. In PHP, you simply go to for the LDAP pieces, or maybe do a search for a PECL library that handles LDAP for you. Then you cobble together a quick model, view and controller using CakePHP’s scaffolding and get the login and logout stuff done. Or you extend the CakePHP authentication modules that are well documented right within the CakePHP manual. Probably about two hours of work.

Now let’s apply this to Rails. Not knowing where to start, and not having a search box on the RubyonRails API page (there isn’t one – how silly), I try some Google-fu to find the equivalent in rails. The first relevant hit is a page that seemed like a match – . An authentication wiki page on Rails own site. Seems legit.

But then I load the page and the first thing I am greeted with is:

“This article is part of the confusing world of Authentication in Rails. Feel free to help: AuthenticationNeedsHelp.”


Then I start examining the list of available plug-ins, gems and solutions to authentication that people have listed. Almost all of them are labeled either deprecated, incomplete or “good for beginning Ruby on Rails user.” Fine, I think, maybe one will work and I just have to find which one. So I start clicking into each page.

LoginGenerator seems relevant.

But scrolling through that page, the text and comments suggest that it no longer works for versions past 2.0.2. But don’t worry – it links to ANOTHER site that swears to be the real solution I am looking for! That’s here – .

Woohoo! This page starts by proclaiming “Yay! (read why)” and then explains that THIS is the right place for an authentication system generator. As if the page already knew that all those OTHER pages one might stumble upon prior were total crap. But before I get too excited, I click on the link which states that “…you really want to see the official Acts As Authenticated Github.” So I bite – I click the link, and am whisked away to the project page, which states right at the top:

“Please note that acts_as_authenticated, is no longer developed/maintained”


So we go back to the drawing board – all the way back to the Wiki page we started with – and look for more. Restful_authentication seems to be the top item, so maybe I should have started there. Again, I click it, and the first comment mentions that some material links to the wrong source. ugh. It then lists four locations to get information. I start with the first one – the official plug-in homepage. It says it’s for rails 1.2. But I’m on Rails 2.2.2. [Sigh] Do I try it? Or go back to the drawing board?

Maybe I am missing something, but one strong part of PHP was the manual and the comments – the manual matched the methods and classes that were actually available almost 98% of the time, and were never incomplete in terms of broken. Does such a resource exist for Rails where I can go to a webpage to find plug-ins and they reliably work and are available? This has to be my #1 frustration with Rails at this point.

If you have comments, please add them. I’d love to hear solutions to how to better manage rails plug-ins, gems and other “goodies” that seem to just be scattered everywhere.

Ruby on Rails installation on CentOS 5.2 – zlib and other errors January 6, 2009 at 9:59 pm

I thought it would be good to share my experience with installing Ruby on Rails w/ CentOS 5.2.

It didn’t get off to a very good start, namely because the person before me had already tried to install rails unsuccessfully. The issue appears to stem from the configure mechanism in Ruby which links against zlib libraries that may or may not be correct. Undoing this was non-trivial.

Specifically I was receiving this error when doing anything with gem:

`gem_original_require': no such file to load -- zlib (LoadError)

Installing zlib and zlib-devel libraries on CentOS did not fix the problem because the linking had already occurred back in the ruby build (I think, anyway). I decided the easiest thing was to do a “rip and replace” fix by ripping out all of ruby and the associate gem software and re-installing. I did this as follows:

1. Remove all packages that were installed via yum

rpm -qa | grep ruby
yum remove [insert results from output above here]

2. Go look for remnants that may have been installed by gem or by a manual compile of ruby and remove them, too. A few places I had to look:

rm -rf /usr/local/lib/ruby
rm -rf /usr/lib/ruby
rm -f /usr/local/bin/ruby
rm -f /usr/bin/ruby
rm -f /usr/local/bin/irb
rm -f /usr/bin/irb
rm -f /usr/local/bin/gem
rm -f /usr/bin/gem

3. Download the latest ruby source and rubygems source to /usr/local/src/ and extract them. At the time of this writing, those commands were:

cd /usr/local/src
tar xzf ruby-1.8.7-p72.tar.gz
tar xzf rubygems-1.3.1.tgz

4. Go into the Ruby directory and compile it, like so:
cd ruby-1.8.7-p72

NOTE: This was the key part to watch. This time around, you should see compile messages stating that zlib was compiled successfully at the end of the log on your screen.

5. Now install Ruby, if all went well:

make install

6. Now go setup RubyGems, like so:

cd ../rubygems-1.3.1
ruby setup.rb

7. Update the gem system for good measure

gem update --system

7. Install Rails

gem install rails

Presto, a nice clean CentOS 5.2 install.

TCAPI Project now out there somewhere… September 7, 2008 at 8:18 pm

Those developers who joined the introductory WebEx today can now access the code that was released. It’s not much, but it’s a good start. Hopefully some folks will commit some stuff to it.

For those who didn’t join today you can still get involved. Please drop me an email if you want to develop some code for what is currently a FreeSWITCH-based GUI front-end for a PBX (and whatever other functions you might desire).

You can reach me here.

Also, I’m curious to start getting feature requests. What makes up a good FreeSWITCH UI? What functions do you want to see? Let me know your thoughts.

TCAPI Pre-Alpha Release (formerly FreeSWITCH GUI Project) September 3, 2008 at 3:53 pm

I’m pleased to announce the pre-alpha (yes, pre-alpha, meaning “doesn’t do very much”) release of the FreeSWITCH GUI project (now named “TCAPI” – the Telephony Configuration API).

Before you get all excited, I want to make sure I’m clear that my main focus has been concentrating on structure and flexibility of the back-end and whatever modularity I could build thus far. I will publish a stack-type diagram shortly to show what I’m looking to achieve. In the meantime, I’m releasing what code has been written (it’s not much) to help people get familiar with the underlying structure of the code. The UI doesn’t *do* anything except configure extensions with various variables that aren’t recognized by default by FreeSWITCH so if you are thinking this GUI will, today, actually do anything for you, keep holding.

Here’s what HAS been accomplished:

  • Implementation of a reasonable AJAX-based JavaScript framework that also implements cross-browser compatible CSS “frames”
  • Helpers have been created to aid in reading/writing XML files with complex element/attribute structures
  • Ability to write your data to MySQL/SQL/Firebird/DB2/Oracle/ODBC/Postgres/etc.
  • Ability to write to raw/native FreeSWITCH XML files via a FreeSWITCH model (+ the start of a DBO layer for FreeSWITCH)
  • Basic controllers with limited logic
  • A lot of work has gone into making the JavaScript work in an abstract-able way, so that a different AJAX framework can be introduced later
  • Menus are configurable without touching any JavaScript. You can write stuff that utilizes the JavaScript framework without knowing or touching any JavaScript directly
  • DHTML/CSS frames-based layout allows for “plugging in” just about anything as a menu item (including scripts in other languages, if necessary)
  • XML save/load models are easy to duplicate, and mapping helper functions are just a few steps away
  • Extensions page is functional and easy to modify/setup/etc.
  • Basic sample pages have been put together for other areas (domains/users/devices)
  • Browser-based AJAX streaming classes have been written/included to allow for streaming channel status information
  • Everything has been written with layers in mind (as much as time allowed for anyway)
  • Oh, and of course, an IRC channel on freenode
  • #tcapi

    Here’s what’s very much missing:

  • A web page describing the software & it’s mission (I have this written, but would like to post it on a nice looking website)
  • A bug tracking system
  • A proper email list
  • A PHPDocumenter-generated (or similar) list of functions & what limited classes/APIs have been written
  • A simple install procedure/instructions/etc. file
  • SIP Profile configuration tools
  • Domain configuration tools
  • A dialplan that allows advanced features being saved to the XML work (stock dialplan)
  • A ‘settings’ page to configure base settings via the UI
  • JavaScript is not properly abstracted on most pages
  • this needs to be completed
  • Pages should be designed to work within the JavaScript frames as well as when they are NOT in the frames
  • The fsxml component needs to be abstracted as a custom behavior

    Other ideas I’m tossing around:

  • Making all HTML and back-end pieces WSDL/SOAP accessibile
  • True APIs – everything has been written as if it was a program for now, but I’m at the point where many things should have get/set/etc. commands added and the related variables that are being modified should become protected, so that things can be moved into libraries.

    A few things have been kept out of the initial check-in until I clean them up, but the channel & conference status pages will be checked in by Friday I hope so that you can monitor calls in progress/etc.

    So what’s next! I am limiting who gains access to the initial files and who commits to the project. I am doing this to gauge interest and because so much still needs to be done, I frankly only want serious, interested developers at this time (even if you can’t commit gobs of time, you need to show your interest in at least learning how the things work). This is mostly to avoid questions and also avoid disappointment from “end-users” who are just out there to try things out, since most of this code doesn’t do very much yet and a lot of hand-holding to install it is still required.

    So here’s what I’ve decided to do. I am going to hold two training WebEx meetings in the next week. The first one will be on Sunday at 11am PST. I will go through the code and how to set it up. I will provide an SVN link at that time to the code and you can follow along with the setup process. All you need is an install of FreeSWITCH on a Linux box + Apache + PHP5 stock libraries. Past that, I’ll get you going, show you how the code is setup, where things are, how to add menu items, how to add a table to the custom model, and so on. And you should be off to the races to try out any of the above items you wish, or some of your own!

    So again, WebEx, Sunday, 11am PST. If you’re interested, please email me and I’ll send you a formal invite with an attendee link.

    If you’re not interested in contributing at this time, just sit tight. I expect a true functional alpha release to be ready within 30 days (or less) that can configure SIP profiles, domains and directory entries completely from the UI.

    You are also welcome to invite others – pass along this URL if you wish.

  • The FreeSwitch GUI Project July 26, 2008 at 2:24 am

    Welp, it’s official.

    The FreeSwitch UI / GUI Project is underway. This week I hope to put the finishing touches on a functioning graphical, web-based user interface front-end that, at the least, adds/edits/removes extensions, adds/edits/removes service providers, lets you setup some basic global features, and maybe even allows you to have a “light” version of a functioning PBX.

    The system utilizes FreeSwitch, CakePHP and some JavaScript/DHTML add-ons. Some may bicker about this, as I am aware it bloats the software a bit, but considering the audience for this is administrators, a bit of bloat in exchange for rapid development and ease of use seems reasonable. CakePHP may also be a source of complaint (compared to Symfony and others, or maybe you just hate PHP), but hey, the reality is CakePHP is under active development and seems relatively lightweight. Best of all (in my opinion) it doesn’t use a templating engine for views. Those things make me cringe when trying to teach people in an open source project how to ramp-up on the coding pieces, and don’t add enough value to warranty this additional hurdle.

    The overall design is easy enough to understand that anyone should be able to dig into the Ajax friendly front-end views without knowing much coding, or add functionality on the back-end where the same assumption applies.

    Here’s a screen shot to wet your appetite…

    Configuration screen in FS demo

    If you’re interested in helping with development, please contact me.