Pulling Ethernet cable to replace a bad WiFi link seems to have fixed the audio dropouts that were plaguing our home phone system, but it didn’t do much to help the two other problems on my to-do list. Like many people using Asterisk with POTS lines, the first dozen seconds of some phone calls suffered from a strong far-end echo. Every time we talked, we heard our voices echoing back at full volume around a half-second later. It made it really hard to carry on a conversation. Fortunately, Asterisk’s echo canceling code killed it off eventually, but we had to suffer with it at the beginning of a lot of calls.

I’d heard reports that changes to the echo cancelling code in the latest Asterisk release, 1.0-rc1, had almost completely eliminated echos for a lot of people. So, I rebuilt Asterisk from source again, installed it, added echotraining=800 to zapata.conf, and restarted Asterisk. And, sure enough, the echo seems to be gone. I made a handful of test phone calls without issues, and a 15-minute call to my parents was perfect. No drop-outs, no echo, and the only noise came from their lousy cordless phone.

So, that left only one thing on my to-do list. The Cisco 7940 phones make it easy to use call forwarding–it’s one of the default softkeys on the main screen. Just press the matching button, enter a phone number, and bam, all of your calls are forwarded. Canceling forwarding is even easier. Unfortunately, the way I had Asterisk configured, all forwarded calls would use our caller-ID information. So, when forwarding our home phone to one of our cell phones, every call would look like it was coming from home, not from whoever was actually calling. Fortunately, since NuFone lets your set your own caller-ID information, it’s possible to leave the existing caller-ID info in place for forwarded calls. I just used this macro:

[macro-condsetcid]
  exten => s,1,SubString(cs1=${CALLERIDNUM},0,4)
  exten => s,2,GotoIf($[${cs1} = ${CALLERIDNUM}]?3:4)
  exten => s,3,SetCallerID(4254889999)
  exten => s,4,NoOp

In essence, it checks the current caller ID number. If the number is 4 digits or less, then it assumes that it’s an internal extension number, so it overrides it with our real phone number. Otherwise, it lets it stay as-is.

Then, I went through my extension.conf and replaced every occurance of SetCallerID(4254889999) with Macro(condsetcid). Now call forwarding works perfectly–the caller’s ID is used instead of our home phone number.

At this point, my Asterisk to-do list is essentially empty. There are a few little projects that I can pick up and play with, but there’s nothing left that needs fixed. It’s reached the point where it Just Works.