Raspberry Pi PBX

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

I’ve been looking at a cheap and flexible solution to having a separate phone number for business calls. I recently came across a post detailing how to use the Raspberry Pi as a PBX. It seems like it will more than cover my needs and as it comes in at under £50 for everything I figured it was worth a go.

I had planned to write a detailed post explaining what was involved in setting it up but it was much easier than I expected.  Essentially you download the image for the SD card use PiWriter to copy img to SD card from the Mac.  Plug in power and ethernet, SSH into the Pi to make a few changes and then everything else can be done via the web interface.

I followed the instructions for installing Incredible PBX on the Raspberry Pi from Nerd Vittles.  Next I needed a VoIP account and as I’m in the UK sadly google voice wasn’t an option.  So I signed up for a free SIP account at Sipgate and then followed these steps to set up a Sipgate trunk.

I’m using X-Lite on my macbook air as my soft phone at the moment.  I have incoming and outgoing calling working perfectly.  Currently calls do go to voicemail if unanswered but no messages are recorded.

The next plan is to set up a VPN tunnel into my home network so I can run a SIP client on my iPhone that will work as an extension of the PBX.  The upside is that as it’s an internal extension there won’t be any charge to pass the call on.  The downside is that it requires my phone to have an internet connection which is a rare thing in Thanet.

Ultimately I want the system to recognise if I’m home or not and automatically divert calls to the appropriate extension.  I’m sure this should be possible by looking to see if my iPhone’s MAC address is connected to the network.  Now I just need to figure out how to make a change in asterisk based on network information.

The project continues…

360 Controller with Lion Continued

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

Following on from yesterday, I downloaded Borderlands from the Mac App Store along with Half-Life 2 Episode 1, Half-Life 2 Episode 2, Portal and Portal 2 from Steam.

Borderlands worked immediately with the 360 controller.  A good start.

Portal 2 also worked straight away but sadly none of the other Steam games recognised the controller.  I tried the exec 360controller command in the developer console but that didn’t make any difference either.  Having done more reading online it appears that the Mac version of Steam doesn’t support gamepads with the source games.  An article written in May 2010 mentions:

Gamepad support, despite it being listed in the options menus for games, is not something the beta has. I was told by Valve earlier that this support is definitely on their to-do list.

Unfortunately it looks like that may not happen as it has now been a year and a half since the article was written and it’s still missing.  I suppose it comes down to the fact that Half-Life 2 is now over eight years old so it predates the xbox 360, Steam and Lion. I’ll keep my fingers crossed that someone will work their magic and make these things talk to one another but I think the chances are slim.

Image Credit Disney

360 Controller + Mac + Steam != Fun

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

I saw a lady on the gadget show playing games on a MacBook Pro with a 360 controller and as I already have two wireless controllers for my 360 I thought it was worth investigating.  A little bit of research online told me that you need a Microsoft dongle to make the wireless controllers work with a computer or I could buy a wired controller for less than the cost of the dongle.

I bought a wired controller this morning and I have spent all afternoon fiddling about but it doesn’t seem to work with Steam.

I installed the driver from here: http://tattiebogle.net/

The preference pane installed perfectly and all the buttons of my controller were recognised including the force feedback rumbles.  This was encouraging.

So I tried GTA Vice City which I had purchased from the Mac App Store.  The camera just span around and around.  I pulled out the controller plugged it in again and it worked briefly before the camera started spiralling again.  I pulled it out and tried again.  This time it worked a little longer but immediately started spinning while I was in a shoot out with the cops.  Not ideal.

Next I tried Half-Life 2 purchased on Steam.  At first the controller did nothing so I triedGamepad Companion which made my character intermittently walk into walls and then refuse to respond anymore.

I looked on Steam’s Support pages and found this article on using and xbox 360 controller with source games.  They mention using the configuration files with Half-Life 2 so I tried that.  Still no joy.

I have now read so many articles and watched about ten videos where teenagers tell me how easy it is to get the 360 controller working on the mac but I still can’t figure it out.  Perhaps it’s the fact that I’m trying it with old games?

I purchased Borderlands from the Mac App Store but I can’t download 9.51Gb on my 0.2Mbps connection so I’ll download it at work in the morning and try again tomorrow night.  Hopefully that will work otherwise the controllers going back and I’m giving up on portable gaming.

jQuery mousemove project.

Note: This post was originally published on iamianwright.com it’s been moved here for archival purposes.

I set myself a little project yesterday to make an image where the head follows the cursor around the screen.  I thought it would be an interesting way to learn jQuery.  I got Shelley to take nine images of me and then I put together a simple test.

The image was set to absolute positioning, 200px from top and 200px from the left.  This allows me to set up a series of if statements that find out if the cursor was in a specific sector.

The example is here: http://clients.imagecircus.com/jquery/

The next step is to make all the measurements relative to the image.  With the current version the image must be absolutely positioned which is limiting.  Ultimately I would like to be able to place the image within a fluid layout and still have the interaction work.

Having done some research online it looks like I need to use minus offsetLeft and minus offsetTop to set the origin to the top left of the image.  I am having some trouble figuring out the code though.  Hopefully one of my developer friends will point me in the right direction.

Other improvements to make are making sure that the sectors overlap as currently there are dead spots between them that show the straight on image and perhaps more importantly preloading all the images.

UPDATE: A photographer friend of mine took some better headshots (seen above) so the example has been updated with those.