Wednesday, July 23, 2008

Installing trixbox

I grabbed the ISO from trixbox.org, and fired up the box I'm going to use as my server, a Dell Optiplex GX280 with 2 - 160GB SATA drives and 4GB RAM.

Using the Quick Install Guide (QIG), I pop in the CD, hit "Enter" to start the installation at 10:43pm... The installer asks for some very basic information and goes on its merry way... The box reboots itself at 10:53pm. There's some strange looking, uh, error? messages during the boot process, but it starts up & I log in.

Since I have my own DNS/DHCP server (using dnsmasq running in a VMWare image), I configured it to always assign the same IP address to this box. Although the box comes up with a host name of "trixbox1.localdomain", I'm not yet brave enough to change that...

I'm now logged in to the web interface. As per the QIG, I log in as "maint". I'd like to change the password, but don't know how and can't find a link to do so. I'm also a bit lost, as the QIG says to click on "Asterisk > FreePBX", but I can't find that anywhere. So, I just started clicking around :-) Finally found what I'm looking for: "PBX -> PBX Settings" from the top level menu.

(Hey! Look! A warning that I'm using the default password! Click on that hoping to be prompted to enter a new password, but no luck...just get an expanded version of the error message...)

Now, on the right, click "Module Admin". Well, I see a bunch of modules, but no where do I see any that I can add, so we'll leave that alone for now... (The important thing, I think, is that "Ring Groups" is marked as "Enabled".)

Continuing with the deviation from QIG, I clicked on "Extensions" on the right-hand menu. On the new screen, I left the default option (Generic SIP Device) and clicked Submit. OK, a rather long form here...
  • Extension: 200
  • Display Name: "Jay"
  • Under "Device Options", set a secret
  • Voice Mail: Change to "Enabled" and set a password and email address.
I left the rest of the options alone, although things like "VmX Locator" sounds possibly interesting...

So now, according to the QIG, I have an extension setup. On to the phone setup...

I went to the admin web page of my Grandstream 2000. I don't want to lose or mess with the setup I have (it works!!!), so I just disabled Account 1, and went into Account 2 settings. Unfortunately, it doesn't seem to register :-(

Digging around, sureteq has a setup guide. Let's see... Hey! Here's how we change the passwords...have to do it from the trixbox's command line:
* Update maint password by typing ‘passwd-maint’ at the command line. Enter the password twice.
* Update AMP password by typing 'passwd-amp' at the command line. Enter the password twice.
* Update meetme password by typing 'passwd-meetme' at the command line. Enter the password twice.
In my attempt to follow directions, I switched to trying to configure an X-Lite softphone on my laptop.

The next thing I learned, is that simply hitting "Submit" isn't enough! You see the orange bar at the top (missed that, didn't ya?!). You have to click that to actually load all the changes... Whew... now my soft phone registers!

Continue on, now with the Grandstream (kinda nice the guy at sureteq also has one!). I'm nervous about changing the "Firmware Upgrade and Provisioning" so I skip that part. I configure the rest, and reboot the phone, but it doesn't register. Well, there's more steps, so before changing the firmware provisioning, I'm going to continue...

After running the setup-grandstream command, I rebooted my phone. It still doesn't register. Going into the extension manager (PBX -> Endpoint Manager from the top menu), I hit 'GO' and sure enough, my phone is found! However, after associating it with the extension and rebooting it again, still not registering.

OK... I'm going to give up, bite the bullet, and change the provisioning... I'm quite nervous, but the pohne does reboot. Uh oh...it's downloading firmware... I'm really nervous now... this is what I didn't want... Well, let's hope it isn't bricked when this is done...

Phone has now rebooted a few times, and appears to be running, but still not registered...

I went through the rest of the setup steps. I think the only thing that tripped me up was the fact that I need to connect to my VOIP provider, which is different than the examples. I discovered that SIP register string in the Trunk configuration is of the form: user_name:password@server. Once I got that right, going to the PBX -> PBX Status shows that I'm registered!

Well, gonna have to work on the Grandstream more later...

Tuesday, July 22, 2008

How to Make a Software Developer Pull His Hair Out

If you're writing any sort of software that you expect others to build off of (e.g., some sort of library), and you want to make sure that your users scream in agony and never need the services of a barber again, here's a few ways to do that:

1. Make sure you've got all the important functionality implemented, but then hide the implementation with private methods and package local classes so that developers can't extend or customize the functionality.
Real-Life Example: At work, we're using MyGWT (well, not for much longer). We have a tree table, and when the user hides (or shows) a column, that needs to be saved (duh). Turns out that for some reason, simply marking a column as hidden doesn't actually hide it. Yet, the functionality works when I click on the menu item! Well, in order to make that happen, I needed to programatically make the same method call that happens when you (un)check the box to hide (show) the column. Good news--that method is protected. Bad news: (a) it's in a class that's automagically instantiated by another class. (b) one of the arguments to that method relies on a package local field of another class. Yikes. Well, 5 silly new classes later, I can stand up and say, "Mission Accomplished".


2. Write your code as inefficiently as possible. You know...call a method (say, foo) which returns an array, find out how many elements are in the array. Then:


for ( int i = 0; i < foo().length; i++ ) {
Thing[] things = foo();
Thing thing = things[i];
}
Yeah, nice, until you peek under the hood and realize what foo() does... Whoa. That wasn't pretty...

VOIP Setup on e90

Whoa...took freakin’ FOR EVER to figure this out... Thanks to Nokia E90 Communicator Blog and the use of X-Lite 3.0 Softphone.

Here's how it goes:
  1. Install & Setup X-Lite. Don't bother with the Linux version...it didn't seem to capture the right information :-(
  2. In X-Lite, turn on all the diagnostics logging.
  3. Make a call from X-Lite. Doesn't matter where to, or even if the party answers. In fact, given the volumes of data in the log file
  4. Dig through the log file. You're looking for "username=..." and "realm=..."
  5. Now, setup the e90:
    • Profile name: (whatever name you want)
    • Service Profile: IETF
    • Default Access Point: (whatever wi-fi you want to use)
    • Public user name: "sip:phonenumber@sip_server" (where 'phonenumber' is of the form abbbcccdddd, and 'sip_server' is the fully-qualified server name or IP address of the server.
    • Use compression: No
    • Registration: Always on
    • Use security: no
    • Proxy Server:
      • Proxy server address: sip:sip_server (same as above)
      • Realm: (what you got from x-lite)
      • User name: (your phone number, same as above)
      • Allow loose routing: Yes
      • Transport type: UDP
      • Port: 5060
    • Registrar Server:
      • Registrar server address: sip:sip_server (same as above)
      • Realm: (what you got from x-lite)
      • User name: (your phone number, same as above)
      • Password: (well, I can't tell you that :-)
      • Transport type: UDP
      • Port: 5060
That's it! Of course, there's still the issue (at least for me) that my VOIP provider only allows a single phone to register at any one time... But, that's why I'm investigating trixbox...

VOIP

For the past 10 or so months, I've been using VOIP service from Avvanta. It's been an extended beta, but now it looks like they're getting ready to finally go live.

Unfortunately, the one feature I really want, doesn't appear to be coming... After a bit of reading, I've discovered that what I want is a "Ring Group". This means that a call comes in, and all of the phones assigned to that group will ring at the same time. Gosh...sounds an awful lot like what I get with zero effort from plugging an old-fashioned phone into the wall.

For example, I have a Grandstream 2000 SIP phone, and I also have a Nokia e90, which I can use with VOIP.

Well, the VOIP service is looking like it's gonna be pretty cheap ($10/month?), so if I can get the ring group, it'll be pretty nice. Who knows, perhaps I can say goodbye to Quest? (Wouldn't *that* be nice!)

So, I'm going to document my trials & tribulations setting up trixbox on a spare box here.