d-man.org   News | Photos | Fun Stuff | Forums

Archive for the ‘Daily Dose’ Category

FreeSWITCH gets a free GUI (and a paid PBX platform)

Wednesday, August 5th, 2009

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 bandwidth.com, 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 bandwidth.com and the FreePBX project, you can now see the documentation and code I’ve been working on at http://www.freepbx.org/v3 .

I also strongly recommend you checkout voicebus.net - a hosted service that is beginning to offer free sandbox development installations for learning and utilizing the new FreePBX v3.0. VoiceBus.net 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 GoCentrix.com 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 GoCentrix.com 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 irc.freenode.net 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…!

Ruby modules are awesome

Monday, January 12th, 2009

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
    end
  end
end

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
    end
  end
end

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
    end
  end

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

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
  end
end

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…

Sunday, January 11th, 2009

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 www.php.net/ldap 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 - http://wiki.rubyonrails.org/rails/pages/Authentication . 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.”

ehh

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 - http://wiki.rubyonrails.com/rails/pages/Acts_as_authenticated .

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”

WTF?!?!

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.

Phish ReUnion : Who didn’t see this coming?

Wednesday, October 1st, 2008

From phish.com:

“Phish returns to the stage for three concerts at the Hampton Coliseum in Hampton, Virginia on March 6, 7 and 8, 2009.

A limited number of tickets are available directly through Phish Tickets’ online ticketing system at http://phish.portals.musictoday.com/ . The ticketing request period is currently underway and will end on Wednesday, October 8th at 11:59AM EST.

Tickets go on sale to the public on Saturday, October 18th at 10 AM EST and may be purchased online at http://ticketmaster.com or by phone at 757.671.8100, 757.872.8100 or 804.262.8100. Tickets will not be available at the venue box office and there is a two-ticket limit per show.

The band intends to announce additional touring in 2009 early next year.”

And a note to others searching for arrangements to the show:
- All hotels within 5 miles of Hampton Coliseum are already booked up
- Get your flights now :-)

TCAPI @ AstriCon

Tuesday, September 23rd, 2008

I’ll be at AstriCon starting today, Tuesday, September 23rd thru Thursday, September 25th.

If you’re interested in the first open-source FreeSWITCH GUI based on TCAPI, or interested in how TCAPI might work with Asterisk, or just want to say hi, look for me @ AstriCon! :)

TCAPI Project now out there somewhere…

Sunday, September 7th, 2008

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)

Wednesday, September 3rd, 2008

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
  • irc.freenode.net #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.

  • Outside Lands - Good things come to those who wait

    Monday, August 25th, 2008

    Friday got off to a bit of a rocky start in my eyes at San Francisco’s inaugural Outside Lands music festival. The polo field simply could not handle the 60,000+ crowd that streamed in to watch Radiohead, and the sound system couldn’t handle it, either. Two complete cut-outs for at least 30 seconds? Unacceptable! I was mad.

    But the festival redeemed itself on Saturday when better weather, more relaxation during the day and the start of a great and more local lineup began. The festival was actually quite well organized for the sized crowd that was present Saturday & Sunday. No lines for beer, IDs, or other stuff. An awesome wine tasting tent. The Visa Signature room was killer, too - a secret spot to hang and enjoy clean portajohns, a nice bar and streaming live music from the stages - if you had a Visa card. Slick promotion if you ask me. And even the weather got better every day - from thick fog Friday night to blue skies on Sunday. This was clearly a festival that just got better over time.

    Mike Gordon’s set was most anticipated by yours truly, and it was OK, but not spectacular. I miss the old Phish. What can I say. Steve Winwood, on the other hand, was unexpectedly “jammy” and there were great improv songs during his set which got the crowd really moving.

    All in all the festival was fantastic. People were respectful, though the park was far from clean when it was over. I hope the festival is welcomed back next year, and I hope a not-quite-so-big headliner is chosen for Friday night so we don’t anger the rest of the city by completely ruining mass transit. (Not that it functions anyway, but, you know…)

    United - What are you doing to loyal business travelers?

    Sunday, August 24th, 2008

    I am a loyal frequent flyer on United Airlines, mostly due to their p.s. service from San Francisco to New York. For roughly $450 round-trip plus the equivalent of $250 in frequent flyer miles, I can usually upgrade to the largest domestic business class seat in the US and get a hot meal on the way. I find this a pretty reasonable fare to pay for a seat and service that is akin to business class on an international flight (and better then first class on most domestic flights), and since I hate flying, I’ll do just about anything to make my experience more comfortable.

    Now the reality is I fly about 20 times a year so I probably generate roughly $10,000/year in airline revenue. Half those flights are NOT on p.s. because I’m not going to New York. But I still keep my business with United so that I can maintain my flying status within the UAL Mileage Plus program. In doing so, I must endure many “normal” configurations of United planes, especially annoying on Ted where business class cabins are not available. This is still a reasonable trade-off to me. Again, the tickets are usually more but the long-term benefit is the EQMs and the increased upgrade availability due to frequent flyer status.

    And the upgraded seats really do help me conduct business. I use the extra space to spread out papers, go through old contracts I have yet to review (though sometimes I’ve already signed), and on a really crazy week I occasionally go through old personal mail. If I’m with a coworker, we can talk business without having an occupied seat in the middle. The value is high to me, because I ultimately save time and energy while I travel, and I also get some good focus time for thinking about difficult problems.

    This latest trend of nickel & diming, however, has now begun to irritate me. It seems that United Airlines has finally gone from catering to business travelers to treating everyone like they are on a Greyhound. As one SF Chronicle article puts it, “The savings they will get doing away with lunch in business class - they will lose more than that when corporations yank business.”

    So what am I so annoyed about? Well yes, it looks like I must finally admit it. I like my airline food. It’s not unusual that I’m catching a 6am flight and haven’t had a chance to grab breakfast, or a noon flight that was directly after a long-running meeting. Does the money actually bother me? No, not really - what bothers me is having to have cash on board. Or having to settle for a shrink-wrapped selection of garbage. Or having to ask a flight attendant for a receipt if I plan to file an expense report for said meal. Or maybe I’ll just absorb the cost out of pocket (as small as it may be), which annoys me further.

    For the first time ever, I am now looking at other airlines mileage programs. This is the worst thing for you, United.

    I really wish you’d just raise the business class fares by $10-20 to cover my meal. Isn’t that reasonable? We business travelers don’t mind. We want to fly without thinking or reaching for our wallets. We’re busy people.

    So please stop with the nickel & diming - it’s fine in coach, but we don’t want “a la carte” in business class.

    The FreeSwitch GUI Project

    Saturday, July 26th, 2008

    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.