Categories
Software

Building Asterisk from source + Cisco SoftKeys

I’ve had a collection of Cisco IP telephones setup in my home for a few years now. It was a covid-lockdown hobby project of mine to figure out how they work and get them setup. Literally 10’s of hours of being stumped trying to get a dial-tone out of them. I started with Cisco 7940 telephones (I have about a dozen of them), then I moved onto 9971 and 9951’s (I have 4 of them) and lastly I’ve moved to Cisco 8831’s (I have 3 of them). All phones I purchased used from Goodwill and the last set of phones seemed to come from a Mortgage broker (or something, I didn’t do too much research). Anyways, I wiped and cleaned the phones and created fresh SEP.cnf.xml files. For those that don’t know, Cisco Call Manager is the default PBX application that powers these phones in industry and it’s obviously propriety and heavy (aka bloat). In Cisco Call Manager, there are GUI’s for everything, so it would be relatively easy (I guess) to use but I never wanted to use it. I built my own PBX directly from Asterisk which is free (as in freedom). I originally used Ubuntu packages for Asterisk and then I switch to running it on a FreeBSD jail using the awesome FreeBSD package repositories and finally I switched to running it in an LXC container inside Proxmox running base Arch Linux. I used the equally awesome AUR (Arch User Repository) to install the Asterisk-cisco package (requires enabling AUR and in my case installing yay and all dependencies).

AUR asterisk-cisco
AUR package I compiled and installed

After I installed the package, I enabled the asterisk service in systemd — systemctl enable asterisk. I copied my sip.conf and extensions.conf configuration files from my previous Asterisk installation and restarted the LXC container to ensure it started up correctly. I connected my Cisco 8831 phone and did a quick call to test while I was watching the Asterisk console and voila it worked! Test call successful *BUT* the softkeys for Messages for instance still didn’t work ;-( These SoftKeys are the exact reason why I wanted to compile Asterisk from source with the brilliant usecallmanager.nz Asterisk source code patch. When I dug a bit further in the AUR package notes I saw the example configuration files that need to be copied to the TFTP server for the phones to consume and configure themselves at boot time. I copied the example files to my TFTProot filesystem on my ASUS wifi router. I then edited my SEP.cnf.xml configuration file and added the following section:

  <phoneServices useHTTPS="false">
    <provisioning>2</provisioning>
    <phoneService type="1" category="0">
      <name>Missed Calls</name>
      <url>Application:Cisco/MissedCalls</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
    <phoneService type="1" category="0">
      <name>Received Calls</name>
      <url>Application:Cisco/ReceivedCalls</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
    <phoneService type="1" category="0">
      <name>Placed Calls</name>
      <url>Application:Cisco/PlacedCalls</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
    <phoneService type="2" category="0">
      <name>Voicemail</name>
      <url>Application:Cisco/Voicemail</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
  </phoneServices>

When I added this PhoneService stanza to my config xml file and then restarted the phone then everything worked! I’m sure a bunch more tweaking needed to “dial in” or “rice” my phone configuration. But, initial success for a Saturday with this project. I now have a working Asterisk IP telephone configuration with freshly firmware updated Cisco IP Telephone 8831 (black and white screen sadly) where the SoftKeys for Messages and Recent Calls work when using Asterisk as a PBX software!

Next steps will be to continue to rice my config and look for Cisco IP Telephone 8861’s which are a color screen and a bit newer. I’ve used 8861’s at work before and I like that phone, a very sharp and colorful display and they have a feature I think that you can do a redirection to mobile phone when away from the desk. Maybe I can get something similar working in my home.

Categories
Life in lockdown Science

Building Asterisk from Source

Today is Sunday. I am building Asterisk 18.9 from source patched with cisco call manager features. See this website for more details: https://usecallmanager.nz/patching-asterisk.html

I’m doing this on a proxmox Linux ubuntu container. This is so I can get my Cisco 9971 phones to work with Cisco call manager features like voicemail button support and BLF (busy lamp field). Why am I doing this? Well, my Cisco phones have been laying dormant for many months while my gaze has been elsewhere. On a lark I plugged them back in and low-and-behold I had 5 voicemail messages. All were from my healthcare service provider trying to sell me stuff. I deleted all the voicemails but it got me thinking that the voicemail button doesn’t work and that’s a shame — I can fix that. Anyways, this is my attempt to fix by building Asterisk from source in a Linux container that has been patched from usecallmanager.