Bring back audio after Asterisk 1.6 upgrade

Written in the mid-afternoon in English • Tags: , ,

I upgraded to Asterisk 1.6 some time ago, but didn’t think anything was wrong until recently. Calls coming in from Callcentric didn’t work: I received no audio. Everything had been working fine with Asterisk 1.4. I don’t get many calls, so initially I dismissed this as a temporary problem. Calls from my other four carriers kept working fine.

After some research, I noticed the following settings suggested by Callcentric:

session-timers=refuse
session-expires=180
session-minse=90
session-refresher=uas

I’ve placed this in the [general] section of sip.conf, because calls from Callcentric arrive from multiple servers and the way Asterisk handles SRV records, only one of the servers ends up mapping into the per-carrier context at any given time. It doesn’t seem to have an adverse effect on calls from other carriers. (It is just turning off functionality new to 1.6, and setting some sensible defaults.)

Perl on the Mac

Written early in the evening in English • Tags: , ,

Mac OS X comes with Perl installed — that’s good. But it doesn’t come with all the modules you may want. On Ubuntu this is no problem: most modules can be found with aptitude as packaged by Ubuntu and their friends. I was trying to think how to manage Perl modules on my Mac in a similar way, so I could track what is installed. What I didn’t think of was the fact that no software is tracked on the Mac anyway, so why should I care.

Thus I should happily use CPAN to add any modules I might need. Maybe not the most secure thing in the world to run as root, but that’s the expected way to do it…

Turns out there is still a hiccup, but apparently just with Xcode 4: there is no ppc assembler on the system, but Perl is configured to expect one. Fortunately others have already figured this out — the full problem and a fix are presented in Perl and Xcode 4.

I guess I should be backing up the list of installed Perl modules somehow.

Total keyboard control

Written at evening time in English • Tags: , , ,

I was researching what people do about keyboard mappings when using virtual machines or remote desktop connections from their Macs, especially when the other system is running Windows. Different software packages map the keyboard differently and some even have different modes that provide different mappings. Now whenever I see a Windows desktop, I have no idea what keys to press anymore.

My research led me to KeyRemap4MacBook. It comes with a kernel driver that lets you map any key presses you like, in one or more applications, on one or more keyboards. All this power is configurable in XML and selectable through a preference panel applet.

I haven’t fixed my Windows keys yet (partially because I realized I might want to keep Alt as Alt, instead of using Cmd), but I have added a binding to switch keyboard layouts using a combination similar to the one used on Windows: Command + Left Shift (or Shift + Left Command, if you prefer). As far as your muscle memory is concerned, this maps to Alt + Left Shift on a PC keyboard.

I switch between the Finnish and US English layouts, so I also needed to add support for the Finnish input mode. This is why I added the bindings in checkbox.xml instead of private.xml (see patch) — you could add similar entries in the latter file for the input modes you need.

Update: My patch has been merged upstream and is included in version 7.2.47 and later.

Using multiple keyboard layouts

Written early in the afternoon in English • Tags: , ,

Hitting Alt Left Shift is second nature to me by now — that’s how you switch keyboard layouts in Windows. I use the U.S. keyboard layout for most things: not just writing in English but also at the Unix command prompt or when writing code. But when chatting in Finnish, the Finnish keyboard layout is a must (for “ääkköset”).

On Mac OS X it is possible to implement something similar, but different. (more…)

Use your iPod with multiple computers

Written at lunch time in English • Tags: , , , ,

Okay, you can use an iPod or iPad with more than one computer, which is good news for me. Just set the device to Manually manage music and videos on its home iTunes computer first.

Unfortunately there are exceptions to this rule: the only iPod that can be freely connected to both Mac OS and Windows computers is the iPod Touch. The iPad allows for this as well.

For more information: Using iPhone, iPad, or iPod with multiple computers

PuTTY: Strange packet received: type 3

Written early in the morning in English • Tags: , ,

Direct connections from PuTTY to Cisco routers kept dying on this error, so I finally ran a search. The workaround is to disable re-key on the SSH session. In the PuTTY settings dialogue, goto

Connection > SSH > Kex

Change the following values to zero:

Max minutes before rekey: 0
Max data before rekey: 0

Source: https://supportforums.cisco.com/thread/2013927

Fixes to VMware Tools

Written at evening time in English • Tags: , , , ,

I just patched a couple of ESXi hosts to 4.0.0 build 256968 and found that VMware Tools were no longer loading after upgrading them. After some digging everything is more or less back to normal. (more…)

Ekiga on the intranet

Written in the mid-afternoon in English • Tags: ,

Ekiga has a problem talking from behind a firewall, or maybe the problem is that both the firewall and Ekiga are trying to be too clever. I’m running siproxd on the firewall to transparently handle SIP connections. All the hardware phones and ATAs as well as X-Lite work well, but Ekiga fails to register.

The fix is controversial: I’m disabling STUN.

gconftool-2 -s /apps/ekiga/general/nat/stun_server --type=string

However, this means Ekiga won’t work from less “intelligent” networks anymore. Since I’m considering Ekiga for my laptop, this might be a problem. Maybe I should try X-Lite under Wine.

Ubuntu doesn’t like AMD?

Written late in the morning in English • Tags: , ,

I’ve been observing a really strange problem on Ubuntu Server 8.04: processes are sitting in limbo not doing anything. I first observed this as phones losing their SIP registrations periodically (but at random intervals).

When debugging the issue, I saw that a ping running on the system would often just sit there, not sending more packets, sometimes for seconds on end (I didn’t always wait to see if it would ever continue). Since hitting a key on the keyboard would immediately be echoed back, it wasn’t a problem with the terminal or ssh connection. Pinging the system from another would work without problems. Interrupting ping would report no packet loss (which was true — you can’t lose replies to packets you didn’t send).

My best guess is that the alternative scheduler chosen by the Ubuntu developers for the server kernels doesn’t work as intended on AMD CPUs (or just the Athlon XP, or some other part of the hardware I’m using).

My “fix” was to switch to Debian 5.0 (lenny), which doesn’t exhibit this problem at all.

I could have tried with the desktop edition of Ubuntu, but can’t really spare the time right now. Especially since I now have something that works reliably again.

I did try with different network hardware, though. I was originally using an SMC card based on ns83820 (but for some reason not reporting anything at all with ethtool — works fine with the gsip driver on NetBSD). I then switched to a Netwjork “brand” card based on r8169 (well liked by ethtool). No difference, but stayed with the latter (working ethtool is always nice).