home

Archive for the 'Computers' Category

PHP mail() logging

Wednesday, January 17th, 2007

I’ve posted my php sendmail wrapper before, but I just noticed that Ilia Alshanetsky has written a php mail logging patch that essentially does the same thing, but from within PHP itself. This is nice because it can log the full path of the file and line where mail() was called, whereas my script can only log as much info as PHP passes to sendmail (which isn’t very much) and what it can get from the environment. The downside is since it’s a patch, it requires recompiling - my script can be dropped into any installation (PHP4/5, and maybe even 3) and just requires a simple php.ini change.

I should also point out that if you’re using this, you should be sure that you don’t “whitelist” localhost in your mail server, or otherwise people can just connect to your SMTP server locally, and send mail without requiring a username or password. If they use SMTP you can’t see what script or virtual host sent the mail either way, but at least if you require authentication you can see what account is being used if it becomes an issue.

freePBX 2.2.0

Tuesday, January 9th, 2007

I haven’t posted here in a while, so I just thought I’d mention something about freePBX 2.2.0, which was just released a couple days ago. For those that don’t know, freePBX is an open source configuration and web-based interface to Asterisk, which allows you to configure and run a PBX that has the equivalent functionality to commercial PBXs costing several thousands of dollars (or more). I’ve been involved with the freePBX project since December 2004 (when it was called AMPortal, or AMP for short), and minus a 6 month hiatus in early 2006, I have been contributing to the project ever since.

2.2.0 is a fairly signifigant release, adding a fair chunk of new functionality, fixing lots of bugs (over 200) including some long-standing bugs that have been around since the 1.x series. Among these are some bugs in the call handling that dealt with certain situations where you pass a call from a queue to a ring group, or going to a cell phone, and then forwarded back to another extension, etc, that were sometimes causing voicemail to never pick up, and some other strange behaviour. I was busy rewriting the modules API to make everything a bit more solid, and wrote a fancy new module administration interface. I also ported a nice new design done by Steven Fischer, which was a much needed upgrade from the basic look that the interface had from the start. I’ve also written some new modules (announcements, phonebook directory, misc applications, speeddial) and done some work on a half dozen others. Overall, we’re quite happy with this release and definately suggest that anyone using 2.x upgrades.

Going forward, there’s a few things I’d really like to do - write some hooks to use QuickForm, to make writing GUI code a lot simpler; finish my text-to-speech and manualconditions modules (which I’ve started on already); finish the daemon to write config files (instead of having the web server invoke a script); write the framework for a user portal; and add a menu before going to voicemail to allow callers to do various things besides leave voicemail.

Now, if I just had a clone or two that could my other day-to-day tasks like go to work, I would be set.

MythTV + PVR150

Sunday, July 23rd, 2006

I have been using MythTV in my living room for the last couple of months, and it’s quite a nice setup. Originally, I got it as a media player after the DSM-320 didn’t live up to my expectations (it’s still usable, but it’s been relegated to the 13″ TV in the bedroom).

MythTV main menuWe don’t actually subscribe to cable, and only get a few network channels that ‘leak’ through from the cable internet, so I never really intended it to act as a PVR. One day I happened to see a good deal on a Hauppage PVR-150 that included a remote, so I figured what the heck.

Recordings screenIt’s nice to have it record a few shows every day, and the “only keep x episodes” feature is handy. I even have it recording the local 6 o’clock news (and only keeping 1 episode) since I never usually watch it at that time. It’s also nice to always have a few episodes of The Simspons to pick through.

Media Library screenI’ve never been a slave to the TV schedule, I’d rather just not watch something than re-arrange the rest of my life around a tv show. For shows that interest me enough, I’ll download them and watch them at my leisure, and never miss an episode or watch them out of order. Having a PVR to do that just makes things easier.

Live TVOverall, myth was fairly straightforward to get working. I installed it on a Debian Sarge box, from source, along with ivtv and lircd.

Program GuideI wanted to post some of my config files, particularly for the remote setup, since it was very difficult to find the files for these, and for some unknown reason almost no one has posted complete configs (that have all the buttons configured) for the remotes.

  • /etc/lircd.conf - Remote definitions for various Hauppage remotes
  • /home/mythtv/.mythtv/lircrc - Mapping of remote buttons to MythTV commands

Caller ID on screen displayI also have asterisk and FreePBX installed to run my phones (I’ll write another post about that another time). One of the nice things about it is I have an on-screen popup when someone calls. I’ve written instructions on how to set up freepbx with mythtv osd on the FreePBX documentation wiki.

It does take a bit of reading and a bit of playing around, but it’s well worthwhile to setup MythTV as a PVR.

By the way: sorry about the crappy quality images for the live TV, it’s from my cell phone camera. I couldn’t take a screenshot of the video output (it just came out blue, like in the program guide picture).