My house is awash in 2.4GHz radio waves. In order to get good wireless LAN and wireless phone coverage at the exterme ends of my house and in the basement, I ended up with 4 2.4GHz base stations, 2 802.11g ones for computers and 2 Siemens ones for voice. I also can occasionally see additional wireless access points of my neigbors houses.
Unfortunately, having 4 of these devices in close proximity, especially the phones ones that do not provide any channel or power configuration, is not practical. There are only 11 channels in the 2.4GHz range and you are supposed to space devices at least 5 channels apart to minimize interference. I set one access point to channel 1, the other to channel 11, and hope the phones would somehow just work out some way to live happily in between. This did not work out and the voice side of things suffered, often resulting in a stuttering audio for the local listener, and incomprhensible sound for the remote listener. Note that the Siemens system worked great when I got it in early 2000, even when I had my original 2mb 802.11 setup.
A friend of mine had done some experimentation with Asterisk. When I found out there wireless phones that would work over WiFi, I decided to stop trying to have two 2.4GHz networks fighting with each other and have a single shared network for both voice and data.
Initially I got a Wildcard X100P card on ebay because my friend had good luck with this. The first one that came didn't work. The seller sent another but Caller ID did not work. After trying my friends, we found that Caller ID didn't work on his either. As a side effect of debugging the Caller ID problem, I did discover crosstalk between my main phone line and my fax line in the office were I was installing
I continued my initial proof of concept test with the X100P card and a Linksys EIP300 WiFi VoiP phone in order to get the go ahead from my wife Jennifer before investing in some higher quality hardware. She wasn't happy that the EIP300 didn't have a charging stand, but the voice quality was great throughout the house. I decided to get the Digium Wildcard TDM400P for my real installation. Specifically I got a TDM422P thatallows me to have both my voice and my fax line potentially integrated with Asterisk, as well as two POTS analog lines hooked up.
trixbox is a CentOS based distribution that will automatically install Asterisk, FreePBX, autodetect common digital telephone hardware, etc. So painless its almost embarassing to admit I used it.
Otherwise, everything should hopefully be green on the status page, with the exception of the HUD Server which is not installed.
Since the registration page did not work for me, I had to login in the upper right to use the Packages page. But this failed because of a 30 second timeout in /etc/php.ini which needed to be increased to 60 along with an "apachectl restart". Sigh. I never had these minor problems with the older trixbox release I used for my proof of concept installation. The packages are really just managed with yum anyway, which I prefer to use instead in this case.
User Extension: 100Click "submit".
Display name: X-Lite
secret: yet-another-password
Display name: X-LiteYou can also setup the voicemail button by going to the "Voicemail" tab of the "SIP Accounts"configuration screen:
User name: 100
Password: yet-another-password
Authorization user name: 100
Domain: host information from your trixbox web GUI
Number to dial for checking voicemail: *97
Setting up a TDM400P is pretty easy, even though its a little harder in trixbox 2.2.4 because of a install bug. Basically, trixbox installed zaptel-modules-2.6.9-34.0.2.ELsmp, even though I need zaptel-modules-2.6.9-34.0.2.EL (for the non-smp kernel it installed). Having resolved that issue, it was smooth saling.
For testing, I wanted to add my old analog office speaker phone as an analog extension on one of the of the FXO ports on the TDM400P.
User Extension: 101Click "submit".
Display name: Office Speakerphone
This device uses zap technology. channel: 1
I can now call between X-Lite extension 100 and the analog phone extension 101.
Now that we can call between extensions, lets set things up so we can dial out To do this I need to setup a trunk and outbound route with FreePBX. This is pretty easy, the instructions are a little longer than necessary just because I want to remove the ZAP/g0 Trunk that is meant for a digital phone interface, in contrast with my analog TDM400P card.
Now I can go to either extension 100 or 101 and dial out to my cell phone to test the sound quality.
Now that we can call out, lets setup inbound calling.
Now incoming phone calls will ring on extension 100. However, this is not really what I want in a home environment. I don't want to just ring one phone but all the phones. Fortunately, ring groups can provide what we want
Now when I call in, both of my extensions ring. One minor issue with this is that I have to remember to update my ring group whenever I add new extensions. A more major issue is that if none of the extensions answers, we just hang up on on the caller. The next step is to setup voicemail so we can direct unanswered calls there. One minor issue is that FreePBX 2.2 seems to only allow creating a voicemail box as part of a specific extension, as opposed to creating a shared mailbox directly which is apparently possible in trixbox 2.3. So as part of setting up voicemail, we'll have to use an extension to create the voicemail box to use for the ring group. We also need to point other extensions such as 101 to use a mailbox of 100@device so that voicemail notification such as stutter dialtone and message waiting indicator (MWI) lights will work.
Now would be a good time to dial in and play with voicemail. You can access voicemail in several ways. From an extension you can use "*97" to directly access this extensions voicemail or "*98" to be prompted for any mailbox. When leaving a message for a mailbox, including from an outside line, you can also press "*" to be prompted to login to the mailbox. Don't forget to record your voicemail greetings and name by pressing "0" from the voicemail box menu.
If you dial in to check voicemail with *97 on an extension other than 100, FreePBX will prompt you for the mailbox number. This is because the FreePBX definition for *97 app-vmmain assumes that the mailbox number is the extension number without consulting the mailbox property of extension we set above, prompting users to enter a mailbox number. The solution is to add our own custom definition for *97 and use the "Feature Code Admin" module to disable the built in FreePBX definition.
; my own version of app-vmmain that always goes to mailbox 100 [from-internal-additional-custom] exten => *97,1,Answer exten => *97,n,Wait(1) exten => *97,n,VoiceMailMain(100@default) exten => *97,n,Macro(hangupcall,)
Cisco IP phones seem to be everywhere. I had one at Ariba, I had one at Stanford, and apparently every TV show from Fox's 24 to NBC's the West Wing uses them as well. So setting up my very own Cisco at home seemed like a cool hack, if nothing else.
Unfortunately, compared to most generic IP phones, Cisco phones are a pain to setup. The first reason is that by default Cisco uses their own SCCP (aka Skinny) protocol, as opposed to the standard SIP protocol. Although Asterisk has a few options to support this, they are not as well documented or integrated with tools such as FreePBX or trixbox. The second reasons is that the phones want to talk to a TFTP server when the boot up to configure themselves. The TFTP server needs to be specified by the DHCP server, and probably no home routers built in DHCP server do not allow a TFTP server option to be specified. So now I make my trixbox server my DHCP box so I can tell DHCP clients such as Cisco phones that the TFTP server is also on my trixbox.
authoritative; ddns-domainname "home"; ddns-update-style interim; ignore client-updates; # If you have fixed-address entries you want to use dynamic dns update-static-leases on; include "/etc/rndc.key"; subnet 192.168.0.0 netmask 255.255.255.0 { option routers 192.168.0.1; option subnet-mask 255.255.255.0; option nis-domain "home"; option domain-name "home"; option domain-name-servers 192.168.0.168; # option time-offset -18000; # Eastern Standard Time option time-offset -28800; # Pacific Standard Time option ntp-servers 192.168.0.168; option tftp-server-name "192.168.0.168"; range dynamic-bootp 192.168.0.200 192.168.0.254; default-lease-time 43200; max-lease-time 86400; } # home zone zone home. { primary 192.168.0.168; key "rndckey"; } # reverse DNS for home zone zone 0.168.192.in-addr.arpa { primary 192.168.0.168; key "rndckey"; } group { use-host-decl-names on; ddns-domainname "home"; host phone123 { ddns-hostname "phone123"; hardware ethernet 00:FF:00:FF:00:FF; fixed-address 192.168.0.123; } [...] }
// Default named.conf generated by install of bind-9.2.4-24.EL4 options { directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; forwarders { 192.168.0.1; }; }; include "/etc/rndc.key"; zone "home" { type master; file "/var/named/data/db-home"; allow-update { key rndckey; }; }; zone "0.168.192.in-addr.arpa" { type master; file "/var/named/data/db-home_rev"; allow-update { key rndckey; }; };
[root@asterisk1 ~]# cat /var/named/data/db-home $ORIGIN . $TTL 38400 ; 10 hours 40 minutes home IN SOA phone.home. root.home. ( 2007090249 ; serial 10800 ; refresh (3 hours) 3600 ; retry (1 hour) 604800 ; expire (1 week) 38400 ; minimum (10 hours 40 minutes) ) NS phone.home. $ORIGIN home. $TTL 38400 ; 10 hours 40 minutes ns CNAME phone phone A 192.168.0.168
$ORIGIN . $TTL 38400 ; 10 hours 40 minutes 0.168.192.in-addr.arpa IN SOA phone.home.mhm. home.mhm. ( 2006021866 ; serial 10800 ; refresh (3 hours) 3600 ; retry (1 hour) 604800 ; expire (1 week) 38400 ; minimum (10 hours 40 minutes) ) NS phone.home. $ORIGIN 0.168.192.in-addr.arpa. $TTL 38400 ; 10 hours 40 minutes 168 PTR phone.home.
nameserver 192.168.0.168 search home
chkconfig dhcpd on
chkconfig named on
service dhcpd start
service named start
For reference on all the dhcpd and named configuration I used a combination of two sources:
Now when we boot a Cisco phone on the network with the trixbox server, it should see the new DHCP server and then try and contact the trixbox's tftp server. However, we still need to configure that to support the Cisco phones.
ln -s /tftpboot/cisco_util/XMLDefault.cnf.xml /tftpboot/XMLDefault.cnf.xml
I used a Cisco document as reference, but it really as useful as the voip-info.org pages:
By now you hopefully have a Cisco phone on your network booting a SIP firmware image obtained from your TFTP server. The final step is to create a SIP extension and use Endpoint Manager to update the proper /tftpboot/SIP*.cnf file. Just make sure to set nat to false in the SIP extension setup or things won't work.
User Extension: 102Click "submit".
Display name: Office Cisco
secret: yet-another-password
nat: no
mailbox: 100@device
The Cisco SIP image has a telnet server which can also be used for configuration and debugging. How 90's! The default password is cisco. There is some command documentation here: http://www.cisco.com/en/US/products/sw/voicesw/ps2156/products_administration_guide_chapter09186a008016107b.html. Something simple to try is "show config"
After setting up the Cisco phones, anything is easy. Most SIP phones just need to have a basic SIP extension like I did for X-Lite. I picked the Hitachi Cable Wireless IP 3000 phone as the main handset for around the house because it was the only one that passed the wife test of having a simple charging cradle base.
Although annoying to configure WEP keys and the like using a phone handset, once done the SIP configuration and other options could be set via a web server running on port 8080 on the phone itself.
Some things I have configured via the phone's web server:
Date Format: DD Jan,YY (Sun) Time Format: 12 hour format hours Time Zone: GMT-08:00 Enable Daylight Savings Time: On
Use SMS: Off
Use Presence: Off
Mode: In-Audio+SIP-INFO
There is a Windows tool called USB Manager. I tried out USBManager2_1_8.zip. It can be used to talk to the phone as a USB device allows you to manage the import and export the device's phone book as a CSV file. Useful if you want to upload the same phone book to a number of phones, but not much else. It also has an admin tool to save and restore phone settings by hitting "Alt-S".
The Hitachi's display a notification for new message. When you hit talk
to dial in to respond to the notification, it displace "asterisk
Unavailable". asterisk -r "sip debug" showed that the SIP NOTIFY message
sent to the Hitachi actually did tell the phone to responed to the
"asterisk" extension. Based on the thread here:
http://forums.digium.com/viewtopic.php?p=48306&sid=a46c4bf48b87998215564470296147e5
I added the following likes to the "[from-internal-additional-custom]"
described above.
Addtion to /etc/asterisk/extensions_custom.conf
; Hitachi phones are told to connect to "Message-Account: sip:[email protected]" exten => asterisk,1,Answer exten => asterisk,n,Wait(1) exten => asterisk,n,VoiceMailMain(100@default) exten => asterisk,n,Macro(hangupcall,)
At this point I had a production PBX system at home. I put away most of my old phones so if my trixbox had a hard drive crash, I would need to get the system back online as quickly as possible.
My first step was a simple rsync backup script. It runs on another box
at home as a daily cron job focusing on backing up the /etc, /var, /root
and /tftpboot directories. The /etc directory, particularlly
/etc/asterisk/ contains most of the vital configuration files for the
sytem. The /var/ directory has important runtime files such as in the
/var/named. The /root directory is just the home directory for the super
user on the asterisk box and I often keep downloaded working files here
so I want it backed up as well. The /tftpboot directory has the files
for Cisco phones.
Example of backup-phone
#!/bin/sh date phone=phone mkdir -p /home/Backup/phone rsync \ --rsh=ssh \ --archive \ --compress \ --partial \ --delete --delete-excluded --cvs-exclude \ --exclude X11/gdm/Init/:0 \ --exclude cups/certs/0 \ --ignore-errors --timeout=600 \ --verbose --stats \ root@$phone:/etc/ \ /home/Backup/phone/etc/ \ | tee /var/log/backup-phone-etc.log | grep -v '/$' rsync \ --rsh=ssh \ --archive \ --compress \ --partial \ --delete --delete-excluded --cvs-exclude \ --exclude backups/dpkg.status.* \ --exclude cache/ \ --exclude empty/ \ --exclude gdm/ \ --exclude lib/apt/ \ --exclude lib/defoma/fontconfig.d \ --exclude lib/dhcp/dhclient-eth0.leases \ --exclude lib/dhcp3/dhclient.eth0.leases \ --exclude lib/dpkg/ \ --exclude lib/logrotate.status \ --exclude lib/logrotate/status \ --exclude lib/tomcat5/ \ --exclude lib/ntp/drift \ --exclude lib/update-notifier/dpkg-run-stamp \ --exclude lock/subsys/cups \ --exclude log/ \ --exclude named/chroot/ \ --exclude run/ \ --exclude slocate/slocate.db \ --exclude spool/anacron/cron.daily \ --exclude spool/anacron/cron.weekly \ --exclude spool/slrnpull/ \ --ignore-errors --timeout=600 \ --verbose --stats \ root@$phone:/var/ \ /home/Backup/phone/var/ \ | tee /var/log/backup-phone-var.log | grep -v '/$' rsync \ --rsh=ssh \ --archive \ --compress \ --partial \ --delete --delete-excluded --cvs-exclude \ --exclude .cache \ --exclude .gkrellm2 \ --exclude .mcop/trader-cache \ --exclude .mozilla/firefox/*/Cache/ \ --exclude .nautilus/metafiles \ --exclude .vnc \ --exclude .xine/session.0 \ --ignore-errors --timeout=600 \ --verbose --stats \ root@$phone:/root/ \ /home/Backup/phone/root/ \ | tee /var/log/backup-phone-root.log | grep -v '/$' rsync \ --rsh=ssh \ --archive \ --compress \ --partial \ --delete --delete-excluded --cvs-exclude \ --ignore-errors --timeout=600 \ --verbose --stats \ root@$phone:/tftpboot/ \ /home/Backup/phone/tftpboot/ \ | tee /var/log/backup-phone-tftpboot.log | grep -v '/$' df -h /home/Backup date
Although I always setup rsync scripts to backup all my Unix and Windows boxes, FreePBX provides some additional backup functionality that it seems worth taking advantage of.
Schedule Name: Daily
VoiceMail: yes
System recordings: yes
System configuration: yes
CDR: yes
Operator Panel: yes
The backups are tar files stored in /var/lib/asterisk/backups. I run backup-phone cron job at noon daily so it will always move the previous FreePBX backups off the machine on a daily basis. You can use a "Run schedule" of "Now" to force an instantaneous backup.
Although at this point I have a functional Asterisk system for the home, my wife does not like the requirement to dial 9. She is especially concerned about out-of-town guests and other visitors being able to use the phone, especially if they needed to place a call in an emergency. It is particularlly frustrating where we live since our local 7-digit numbers start with 9. I was dreading this as one of things that would be possible in an arbitrary Asterisk configuration but perhaps impossible using the FreePBX interface but I couldn't have been father from the truth.
311 411 511 611 911 011. 1800NXXXXXX 1866NXXXXXX 1877NXXXXXX 1888NXXXXXX 1NXXNXXXXXX NXXNXXXXXX NXXXXXXI used the dial pattern wizard to construct most of these.
Another issue that came up within the first day of active use was wanting to return calls based on the Caller ID information from the call log. The outbound route I had setup already matched numbers of the form NXXNXXXXXX but the phone company kindly informed me I needed to dial a 1 before that type of number. Fortunately there was a very simple solution to this issue:
I think at one company I worked at they never managed to get this working, meaning you could return calls to internal extensions from the call log but not external calls. I'll leave you to draw your own conclusions from this...
In my "Family_Friendly" outbound route I made sure to include 611 as a dial pattern to go to the ZAP/3 trunk. However, 611 is hardwired to go to nv-weather.php in /etc/asterisk/extensions_trixbox.conf. I googled about 611 and found some references to setting it up using the "Misc Destinations" module. I figured I should install that to see if it would let me remap 611 to some other number.
Unforunately it is not managable through the "Misc Destinations" module like it probably should and could be... The simple solution to get real 611 working is do replace the string 611 with something else like 612 in extensions_trixbox.conf file followed by a "service asterisk restart".
Having done this, I found that weather, now on 612, didn't actually work anyway. Seems like the provided script depended on pdaweather.org which changed its website. A newer version using NOAA data seems to be available from: http://bestof.nerdvittles.com/applications/weather-airport/ I just commented out the 612 extension in extensions_trixbox.conf.
While I was in extensions_trixbox.conf, I noticed *61 as an alternative weather script, but it also was not functionally so I disabled it as well. I did also find the *62 wakeup call application which seemed to work...
TBD
Perhaps http://lists.digium.com/pipermail/asterisk-users/2006-February/140818.html
No solution found for trixbox 2.2 with Asterisk 1.2. ZapBarge will let you listen in on a zap channel and ChanSpy allows a little a little more functionality including the ability to listen in on non zap channels. However, in Asterisk 1.4 ChanSpy includes a whisper option that will let you talk to as well as listen in on a channel. So to get this to work, you'll need to upgrade to trixbox 2.6.
Hold music is not really that important for a home system. However with our old system, there was nothing but silence on hold and that made callers nervous that they had been disconnected. Give how it easy it is to do better with FreePBX, I thought I would play around. It turns out there is some hold music already installed with FreePBX, but we can add our own. I grabbed the public domain classical music performed by Elena Kuschnerova and Lev Guelbard from: http://www.aussievoip.com.au/sounds/allsounds.tgz
You can then use "Music on Hold" from FreePBX setup to add or remove music files from the hold rotation.
The webmin tool lets you administer common linux settings from a web gui instead of directly from text files. As mentioned before, you can install such packages through the trixbox Packages page or via yum. Once installed you can access webmin though port 10000 on your box via a URL like http://phone:10000/.
This will make sure we get the latest security updates automatically.
chkconfig yum on # enable yum service on next reboot service yum start # start yum service now
You can also set an "Update Email" addresses under FreePBX "General Settings" module to send notifications of available FreePBX updates.
If you are really going to be running a production Asterisk server, it is probably a good idea to sign up to receive announcements about import update and security issues: http://lists.digium.com/mailman/listinfo/asterisk-announce