Content here is by Michael Still mikal@stillhq.com. All opinions are my own.
See recent comments. RSS feed of all comments.


Thu, 10 Nov 2011



Setting up Cisco 7961 IP phones with asterisk



    This blog post is just my notes on the installation process I followed. There is lots of documentation out there, but a lot of it is contradictory or incomplete. These notes are mostly about the configuration in my house, and might not work for you. Sorry about that.

    The first step is that you need to be running your own DHCP server. Running a simple embedded one in something like your DSL modem wont cut it, as you need to hand out non-standard options in your responses in order for the Cisco firmware on the phone to find the TFTP server you'll set up in a bit. I'm not going to document installing DHCP here, as the Ubuntu packages are reasonable. In fact, the only annoying bit about the packages is that all the config et cetera is in a directory named /etc/dhcp, but for some reason I can't explain the init script is /etc/init.d/isc-dhcp-server. That throws me every time.

    You also need to know the MAC address of the phone. This is probably on a sticker on the bottom, failing that it is on the screen during the phone boot process. Absolute worst case, it is in the DHCP logs once the phone starts to boot. The DHCP config for my phones looks like this:

      option domain-name "home.stillhq.com";
      option domain-search "home.stillhq.com", "stillhq.com";
      option domain-name-servers 192.168.1.14;
      
      option routers 192.168.1.254;
      option broadcast-address 192.168.1.255;
      
      option ntp-servers 192.168.1.14;
      option smtp-server 192.168.1.14;
      option time-servers 192.168.1.14;
      
      default-lease-time 600;
      max-lease-time 7200;
      
      option cisco-etherboot-server code 150 = ip-address;
      
      ...
      
      # IP Phones
      group {
        option tftp-server-name "192.168.1.14";
        option cisco-etherboot-server 192.168.1.14;
        option arp-cache-timeout 600;
      
        host cisco-7961-1 {
          hardware ethernet 00:1a:a1:ca:04:5b;
          fixed-address 192.168.1.50;
          option host-name "cisco-7961-1";
        }
      }
      


    I also added the phone to DNS with a reverse entry, but I don't think that is actually required for the phone to work. Next I needed a TFTP server, which is something I haven't bothered to run for years. I used HPA's TFTP server, which again has reasonable-ish packages. One gotcha is that you need to install xinetd as well, and then disable the init script for the HPA TFTP server. As best as I could tell the default non-xinetd configuration simply didn't work, so I don't know why they package it like that.

    Now for the really hard bit. You need to find the right firmware for the phone. I have my suspicions this is a lot easier for the modern Cisco phones, which have a web server by default and can be configured without TFTP. I say this as someone who doesn't actually have one of these phones, but who has read some stuff online about them. These older phones are really TFTP happy, and seem to be constantly chatting to the TFTP server, even if they're healthy. That might be an issue if you're deploying thousands of these phones -- you'd have to monitor TFTP server load and be aware of the extra IO during global phone firmware updates.

    There are two ways to get the firmware for the phones. You can buy a support contract from Cisco for not very much money (around $20 a year), or you can find dodgy copies cached on the internet. If you choose to go the dodgy route, this this Whirlpool thread has some useful advice.

    Next we need to do a factory reset on the phone. This might not be needed in absolutely all cases, but its just safer. To reset the phone, hold down the # key and power cycle the phone. The lights at the side of the screen will start flashing in sequence after a while (nearly a minute). You now press 123456789*0# within 60 seconds of releasing the # key you were holding down. Note as well that the Cisco documentation for what lights flash is wrong, but it didn't seem to affect the outcome.

    The phone is really slow to boot up (several minutes). Once it has booted, it grabs network configuration for DHCP as shown above, and then starts requesting files from the TFTP server. Here's a log of all the requests from my phone booting when its happy:

      $ tail -f syslog | grep RRQ
      Nov 11 06:24:53 molokai in.tftpd[8221]: RRQ from 192.168.1.50 filename term61.default.loads
      Nov 11 06:24:54 molokai in.tftpd[8222]: RRQ from 192.168.1.50 filename Jar41sip.8-3-0-50.sbn
      Nov 11 06:24:57 molokai in.tftpd[8223]: RRQ from 192.168.1.50 filename cnu41.8-3-0-50.sbn
      Nov 11 06:25:00 molokai in.tftpd[8224]: RRQ from 192.168.1.50 filename apps41.8-3-0-50.sbn
      Nov 11 06:25:11 molokai in.tftpd[8235]: RRQ from 192.168.1.50 filename dsp41.8-3-0-50.sbn
      Nov 11 06:25:15 molokai in.tftpd[8236]: RRQ from 192.168.1.50 filename cvm41sip.8-3-0-50.sbn
      Nov 11 06:26:33 molokai in.tftpd[8242]: RRQ from 192.168.1.50 filename CTLSEP001AA1CA045B.tlv
      Nov 11 06:26:33 molokai in.tftpd[8243]: RRQ from 192.168.1.50 filename SEP001AA1CA045B.cnf.xml
      Nov 11 06:26:41 molokai in.tftpd[8244]: RRQ from 192.168.1.50 filename SIP41.8-3-1S.loads
      Nov 11 06:26:42 molokai in.tftpd[8245]: RRQ from 192.168.1.50 filename Jar41sip.8-3-0-50.sbn
      Nov 11 06:26:44 molokai in.tftpd[8246]: RRQ from 192.168.1.50 filename cnu41.8-3-0-50.sbn
      Nov 11 06:26:47 molokai in.tftpd[8247]: RRQ from 192.168.1.50 filename apps41.8-3-0-50.sbn
      Nov 11 06:26:59 molokai in.tftpd[8249]: RRQ from 192.168.1.50 filename dsp41.8-3-0-50.sbn
      Nov 11 06:27:02 molokai in.tftpd[8253]: RRQ from 192.168.1.50 filename cvm41sip.8-3-0-50.sbn
      Nov 11 06:27:59 molokai in.tftpd[8256]: RRQ from 192.168.1.50 filename CTLSEP001AA1CA045B.tlv
      Nov 11 06:27:59 molokai in.tftpd[8257]: RRQ from 192.168.1.50 filename SEP001AA1CA045B.cnf.xml
      Nov 11 06:28:14 molokai in.tftpd[8261]: RRQ from 192.168.1.50 filename /mk-sip.jar
      Nov 11 06:28:15 molokai in.tftpd[8262]: RRQ from 192.168.1.50 filename US/g3-tones.xml
      Nov 11 06:28:18 molokai in.tftpd[8263]: RRQ from 192.168.1.50 filename dialplan.xml
      


    No, I don't know why it requests those files at the start twice either, but it does it across multiple test factory resets. There are two files there which embed the MAC address of the phone into the filename, so you'll have different names for those files in your setup. Note that the file CTLSEP001AA1CA045B doesn't exist in my configuration, and that doesn't seem to have caused anything bad to have happened. Filenames are also case sensitive, so that might make things more exciting for you. Almost all of the other files are firmware.

    I recall creating a file named XMLDefault.cnf.xml which has a bunch of stuff in it, but I can't see any evidence that it is used during the book process, so I think that might have been a dead end that I didn't need to go down.

    The format for SEP001AA1CA045B.cnf.xml is well documented in the links below, so I will leave that as an exercise for the reader. Feel free to ask questions in the comments to this post, and I'll do my best to be helpful, bearing in mind that I am absolutely not an expert at this stuff.

    Here's a list of the web pages I thought were most helpful during my adventure:

    Tags for this post: blog asterisk voip sip cisco 7961 tftp dhcp system_admin
    Related posts: Configuring Asterisk; Using an Intel PCI modem as a FXO card; Worst timing evar!; Building an answering machine using a $10 winmodem

posted at: 23:36 | path: /diary | permanent link to this entry


Mon, 09 May 2011



Performance pay for teachers

    I don't really want to have a fight with Paul, but I disagree with his stance on performance pay for teachers. I respect Paul on many levels, and perhaps sometimes we should just agree to disagree on some things.

    However, I find his attitude towards performance pay defeatist. As best as I can tell his argument can be summarized by this quote:

    The problem is: how do you judge the teacher's actual performance? How do you separate this from the abilities of their class? How do you know, empirically and repeatably, that they're better than another teacher?


    I think you can measure this. You can test basic skills at the start of the year, and then at the end. You can then compare this with the other students across the entire country at that year level, and determine what is an above average improvement based on statistical modelling. Sure, that wont test if a child is inspired to become a great artist, but the most important role of schools is to provide our children with the skills needed to survive in a modern society. If the artist can't count and read, then they're going to have a much harder life.

    Now, I don't claim that naplan is a perfect measurement system, but then again it is very new and it takes time to get these things right. Henry Ford didn't go into his workshop and come out with a Toyota Corolla. Instead he built something relatively crap, and then the world iterated. Let's give naplan time to iterate and improve before we write it off.

    Another argument I've seen is that teachers don't teach in isolation, and we should therefore not attempt to measure their performance. Its something about parents et cetera affecting learning outcomes. So, I have a couple of counter points. I also don't work in isolation, given I work on a team with 700 other people, and yet we still manage to measure my performance. Perhaps that's because part of my job is to advocate with others that they work on the bits that I need them to work on. Its the same with teachers -- part of the job is to encourage and support parents as well as children, and to do whatever it takes to help the child learn. Surely we don't want defeatist teachers who just give up if not everyone immediately falls over to help them out?

    Also, the statistical sample for children at a given year level is huge, and surely if unsupportive parents is a problem, the statistics will handle that. This is especially true once we let the system run for a few years and gather some baseline data. Worst case if a school is in a disadvantaged area, or the teacher works with kids with special needs, then a tweak to the numbers can be applied to compensate for that.

    Another thing which is huge is the proposed bonus pool -- $425 million is a lot of money. I'm hoping this means a lot of teachers get a good bonus.

    Ultimately this is too important a problem to just give up on because it is hard. When I went to school, a lot of my friends put teaching down as their last choice degree, not because they cared about teaching, but because it was a safe comfortable job out of the rain. We need to stop attracting those people to teaching, and redirect talented people there. To a certain extent people go where the money is, so if we can find a way to pay good teachers more money than they would earn doing real estate conveyancing, then that's a good thing. The bonus scheme is part of that.

    Anyway, I'm not really trying to convince Paul here, we can agree to disagree I think. I'm just trying to explain my stance.

    Tags for this post: blog teacher school performance pay
    Related posts: Australian teachers advocate a China style firewall for Australian internet users; Controlling DirecTV STB via USB; Does anyone else think its odd; Apple's Safari javascript implementation; Thinkpad x41 tablet PCMCIA IO; Python effective TLD library update; How do you summarize ten years of your life?; MySQL Tech Talks

posted at: 23:52 | path: /diary | permanent link to this entry


Mon, 31 Jan 2011



On the flood levy

posted at: 16:57 | path: /diary | permanent link to this entry


Mon, 18 Oct 2010



Rosella

    I was out the back reading at lunch time, and got these nice shots of this lovely rosella.

                   

    Tags for this post: blog pictures 20101018-rosella photo

posted at: 01:24 | path: /diary/pictures/20101018-rosella | permanent link to this entry


Sat, 24 Apr 2010



Adding Open Flash Charts to my home monitoring

posted at: 16:13 | path: /diary | permanent link to this entry


Sun, 14 Mar 2010



Bad science: Ben Goldacre vs Rentokil, a twitter timeline

posted at: 13:10 | path: /diary | permanent link to this entry


Sun, 07 Feb 2010



Home power measurement

posted at: 23:55 | path: /diary | permanent link to this entry


Sun, 19 Jul 2009



An awesome weekend

posted at: 01:54 | path: /diary | permanent link to this entry


Wed, 27 May 2009



Taking over a launch pad project

posted at: 07:35 | path: /diary | permanent link to this entry


Sat, 16 May 2009



Early Father's day

    The kids aren't going to be in the same country as me for US father's day (I get two this year!), so they gave me my present early. I now have a complete set of UK police riot armor -- the helmet, shield, and leg protectors. This has already come in handy whilst parenting hyperactive children. I wonder if its legal for me to own such things in Australia?

    Digging a bit further, it appears:
  • Possessing soft body armor (for example ballistic Kevlar) is illegal in the ACT except for those employed by licensed security organizations -- PROHIBITED WEAPONS REGULATION 1997, section 12.
  • In fact, the Commonwealth customs regulations mostly seem concerned with the possession or import of armor intended to stop bullets -- CUSTOMS (PROHIBITED IMPORTS) AMENDMENT REGULATIONS 2005 (NO. 4) (SLI NO 249 OF 2005)

    I can't see any mention of riot armor (which wouldn't stop a bullet) though, nor a reference to militaria, apart from militaria fairs needing a permit. I wonder if anyone else has thoughts on this?

    Tags for this post: blog toys riot armor

posted at: 18:21 | path: /diary/toys | permanent link to this entry


Thu, 14 May 2009



CCD Barcode Scanner

    I just picked up a CCD barcode scanner cheaply on eBay. The plan is to use it to bulk enter a bunch of books into my book database. Many US books don't have bookland barcodes, but instead have something which looks like this:



    So, the barcode has no problems with the big barcode on the left, however it doesn't recognize the little barcode on the right. So, does anyone know what format that little barcode is in? What mode do I need to put my barcode scanner into to get both barcodes read, either at the same time or individually?

    Update: once again the Intern has earn his Intern-chow (or whatever it is he eats when he's allowed out of his cage). The deal was I needed to scan the magic "make all possible barcode types work kthxbye" barcode in the book of exactly 1 billion configuration barcodes. It all works well now. I wont mention the Intern's name, because I want to hire him and need more security through obscurity in my life.

    Tags for this post: blog toys barcode scanner

posted at: 21:46 | path: /diary/toys | permanent link to this entry


Tue, 12 May 2009



LinkedIn and Facebook

    I just went through and dealt with my huge (some from 2006!) backlog of LinkedIn and Facebook invites. I'm terrible with names, so if I mis-rejected someone I apologize. I'm also trying to keep FB and LinkedIn separate -- LinkedIn is for people I know professionally, and Facebook is for people I don't mind telling about my hat collection.

    I am sure you found this post enthralling. That is all.

    Tags for this post: blog linkedin facebook
    Related posts: Solutions for the pollution of a social network?

posted at: 19:48 | path: /diary | permanent link to this entry


Wed, 06 May 2009



Link mailing list complains about twitter, news at 11

    I'm starting to get quite annoyed with the level of complaining about twitter on the Link mailing list. It seems that people can't understand why a short form status publishing service is interesting. Fine. But the bit I don't get is why they can't just ignore it -- its not like anyone is forcing them to use it... Its a bit like MySpace. If you don't like it, just ignore it.

    That is all.

    Tags for this post: blog twitter link
    Related posts: Bad science: Ben Goldacre vs Rentokil, a twitter timeline; On Twitter

posted at: 16:03 | path: /diary | permanent link to this entry


Thu, 12 Mar 2009



I love my intern

    Will Nowak rocks. I have no other way of saying it... He's been interning with me at work for a few months now (although this is something like his third internship with the company), and he has this amazing ability to dive right into a project and make it fantastic. I say this not only because he's doing a great job on the project he was handed at work, but also because he's taken the code for my iTunes replacement (which was always a quick and dirty hack), and done awesome things with it as well. We should hire this guy.

    Why am I saying this here? Because I couldn't contain my delight any longer.

    Tags for this post: blog

posted at: 09:45 | path: /diary | permanent link to this entry


Wed, 11 Mar 2009



iTunes replacement part three

posted at: 17:47 | path: /diary | permanent link to this entry


Mon, 09 Mar 2009



Redirect to a file:// URL?

posted at: 19:43 | path: /diary | permanent link to this entry


Sun, 08 Mar 2009



iTunes replacement progress

posted at: 19:29 | path: /diary | permanent link to this entry


iTunes replacement

posted at: 10:57 | path: /diary | permanent link to this entry


Fri, 06 Mar 2009



How Amazon lost the sale

posted at: 17:04 | path: /diary | permanent link to this entry


Wed, 25 Feb 2009



Roomba Battery Repack 1

    I bought two different versions of the Roomba battery repack kits from ebay and the first one arrived today. This is the nicer of the two versions, because it includes pre-soldered tabs on the battery wires. It cost me an extra dollar, and was about $26 including shipping. To be honest, if I'd found this one first I probably wouldn't have bought the one without the tabs.

    Here is the contents of the kit:



    Note that there are no instructions in the kit.

    The first step is to open up the battery case. The screws are pretty obvious, although the triangular screw driver than the kit ships with sure made this easier. Then you need to crack open the case, which for some reason is glued shut. That took a bit of patience, a jewelers screw driver, and in the end a hammer. I started out not wanting to bash the case too much, but it was glued pretty solidly. In the end it opened up just fine though:



    Now you just need to put the new pack in, making sure to get the tabs in the right places. Screw the lid shut, and go for it. My roomba is charging at the moment, and I'll let you know how it goes once that's done.

    (You might recall this means that I now have two fully functional roombas. I'm thinking of building the serial control cable, hooking up arduinos, and having some sort of swarming vacuum system. Its a pity I don't know anything about swarming algorithms...)

    Tags for this post: blog toys roomba battery repack
    Related posts: New Roomba batteries; Debugging reboot problems with a n800?; Alan Cox's IBM ThinkPad explodes; Dead Roomba battery; Dells are now explosives, and therefore not allowed on planes

posted at: 16:43 | path: /diary/toys/roomba | permanent link to this entry