I thought I'd give a little update on what's going on in my Asterisk installation as some of the stuff might be useful for you:

Speed Dial

If you have Snom Phones and want to program the function keys to dial a certain number, be sure to select "Speed Dial" and not "Destination" when entering the number.

Destination was used in earlier firmwares but it now used to not only make the phone dial that number, but also subscribe to the line to make the LED light up when the line is used.

This obviously makes no sense at all with external numbers and requires some configuration for internal ones (see below). The additional benefit is that buttons with "Speed Dial" assigned don't turn on the LED.

Dial by click

You can dial a number from the Mac OS X address book aswell. Asterisk will make your phone ring and redirect the call once you pick up (just like AstTapi on Windows). I had the best experience with appnotify. I don't quite like the way how it notifies clients of incoming calls (hard-coding IP-Addresses of clients is NOT how I want my network to operate), but maybe there will be a better solution later on. Currently, I'm not using this feature.

Dialing works though.

You don't have to modify manager.conf, btw, if you already have the entry for the AstTapi-Solution. appnotify will ask for username (manager context) and password when it launches the first time.

Subscription

As noted above, your Snom Phone can be advised to monitor a line. The corresponding LED will blink (asterisk 1.2+) when it's ringing and light up when the line is busy.

Snom-wise, you'll have to configure a function key to a "Destination" and enter the extension you like to monitor.

Asterisk-wise you have to make various changes:

sip.conf

  • Add subscribecontext=[context], where context is the context in extensions.conf where the corresponding SNOM phone is configured in. I've put this to the [general]-Section because all phones are sharing the same context (internal).
  • Add notifyringing=yes if you have Asterisk >= 1.2 and want to make the LEDs blink when the line is ringing.

extensions.conf
This is a bit hacky: In the sip-context add a notify extension for every line you want to be allowed to be monitored. Unfortunately, you can't use macros or variables here, so it's messy.

On my configuration it's:

[internal] exten => 61,hint,SIP/61 exten => 62,hint,SIP/62 exten => 63,hint,SIP/63 exten => 64,hint,SIP/64 exten => _6[1-9],1,Dial(SIP/${EXTEN},,tWw)

While I would have preferred

[internal] exten => _6[1-9],hint,SIP/${EXTEN} exten => _6[1-9],1,Dial(SIP/${EXTEN},,tWw)

Though this may have been fixed with 1.2.2, but I'm not sure just yet.

You may have to reboot your phone after making the configuration change there. To check the registration in asterisk use SIP show subscriptions.

You should get something like this:

asterisk*CLI> SIP show subscriptions Peer User Call ID Extension Last state Type 192.168.2.152 62 3c26700b57e 61 Idle dialog-info+xml 1 active SIP subscription

This is not quite tested as of yet because the guy at extension 61 is currently in his office and I don't want to bother him ;-)

Update while editing/correcting this text: It works. They guy has left and I checked it.

Read on →
img_hc_ajaxfreshflavour.jpg

Today, my hardcopy of Pragmatic Ajax arrived. I bought the bundle edition consisting of the PDF beta version of the book and the printed edition.

It's a wonderful book. I have been doing AJAX since a bit earlier than the launch of Google Maps, but I still thought that I need some brushing up especially in the matters of usable frameworks (I've been doing everything from scratch) and useful practices.

Considering that I liked every book of the Pragmatic Programmers I've read so far (we share the same mindset I guess), the decision to buy that book was a non-issue.

I've been reading the PDF-edition so far and completed about the first half of it, but I'm very happy now to see the dead-tree edition as reading that is much easier in terms of handling (no cheap printouts and no computer needed to read it).

The first half was very interesting, but I think I'll better write a complete review once I'm through with it.

And in case you wonder what that picture above means... Well... Here in Switzerland, we have a brand of cleaner fluid which is called AJAX.

And we have had that for years, so they are not just riding some strange fashion mood like these guys. I wonder if the inventor of the AJAX acronym knew :-)

Read on →

GPRS in your mobile phone and bluetooth are a real dream-team: Phones like that are small, fit in your pocket and still, they allow you to connect to the internet from your laptop - and even at reasonable speeds.

In contrast to the widely spread PC-Cards or wired connections, the handling too rocks: Just keep your phone in your pocked, dial from the laptop and use the internet. No fiddling with cards (or drivers. or strange software. your OS comes with all it needs to get the connection going), no problems with forgotten cables.

Bluetooth brought simplicity to the connection with your phone. Earlier we had infrared or cables, but nothing works as reproducibly as bluetooth does - at least in Windows.

As you know, I switched over to using Mac OS for my main office workstation. And today I was in the situation of needing internet in train and at a customers site.

Naturally, I wanted to use my mac to connect via Bluetooth to my K750i to use it's GPRS capability.

While the bluetooth stack provides a very nice assistant to add a new bluetooth device and even allows you to create the GPRS connection, unfortunately, it does not work in the end.

Apple does provide some very specialized modem scripts, which is both good and bad. Good because if there's a script for your modem/phone, it'll work perfectly. Bad because if there is no script, it won't work at all.

The assistant provided a list of Ericsson phone scripts and suggested using "Ericsson Infrared". Naturally I first tried connecting with that, dialing *99***3# as I would in windows (the GPRS data connection being the third configured connection on the phone).

The phone did not even begin the dialing process.

I rebooted the Mac, launched Windows, created the RAS connection there and connected via GPRS to google for a solution (oh the irony...).

And I quickly found one: The modem scripts by Kia ora Ross

One thing to note though: You must use the script using a CID which is not configured on your phone (which is different from windows) and use the name of the APN as phone number (which also is different). With that in mind, connecting is easy.

What remains to be told: Apple which claims to be the superior OS usability-wise fails on this not-so-advanced task. Not only that. It fails in multiple ways:

  • It does not provide a generic modem script (like Windows does)
  • It suggests a completely non-working solution (instead of telling "sorry. I have not matching script.")
  • One you get the right scripts, you have to click the "Show all"-Checkbox to be actually able to select it - despite all scripts listed in the default configuration being completely unusable.

So I'm coming back to what I was saying all the way: OS X or Windows? Doesn't matter. Both have advantages. Both have disadvantages. Neither is clearly more usable than the other. Just go with what you feel more comfortable and live with the problems.

Oh and: Setting up a GPRS connection via a bluetooth-connected phone arguably is not a task doable at all for the people OSX was designed for. So it's probably OK if it's a bit harder. But still.... I'm not very happy about this.

PS: This is written and posted during a train ride. Connected via GPRS. Written on my MacBook Pro.

Read on →

As you no doubt know by now, I'm gradually switching over from using Windows to using Mac OS X.

I have quite some experience with using Unix and I'd love to have the power of the command-line combined with the simplicity of a GUI here and then.

OSX provides that advantage to me: For one, I'm getting a very styled and time-tested UI, the ability to run most applications I need (this is where Linux still has some problems) and on the other hand, I'm getting a nice well-known (to me) command line-environment.

Of course, in my process of switching over, I made some tweaks to the system, I'm sure some of my readers may find useful:

  • Use a useful default shell: I very much prefer ZSH, so chsh -s /bin/zsh was the first thing I did.
  • Use a useful configuration for said shell: I'm using this .zshrc. It configures some options, enables a nice prompt, fixes the delete-key, sets the path and does other small cosmetical things.
  • Install the developer tools. They are on your install DVD(s).
  • Go and install Fink. No UNIX without some GNU utilities and other small tools. The current source-distribution works perfectly well with the intel macs.
  • Fix the Home- and End-Keys.
  • Tweak the terminal: Open the Window-Settings, chose "Display", use a reasonable cursor (underline) and set your terminal to Latin-1 (I had numerous problems using UTF with ZSH). If you want, enable Anti-Aliasing. Then chose "Color", use the "White on Black" preselection and play with the transparency slider. Use the settings as default.
  • Install VLC - your solution for every thinkable multimedia need. Watch out to get the Intel nightly if you have an Intel Mac.
  • I never use sleep-mode because it feels "wrong" not to shut the machine down completely. That's why I entered sudo pmset -a hibernatemode 1 to make the "Sleep" option in the Apple-Menu work like Hibernate in Windows.

If you are a web developer on an intel mac and consider using PostgreSQL, don't use the premade builds on entropy.ch because they are still built for PPC. You may use the StartupItem which is provided there though. If you do, call PostgreSQL's configure like this to get the paths right:

./configure --prefix=/usr/local/pgsql --bindir=/usr/local/bin --with-openssl \ --with-pam --with-perl --with-readline --with-libs=/sw/lib\ --with-includes=/sw/include

This is after you've installed readline using fink. OS X itself does not come with readline and psql without readline sucks.

After installing PostgreSQL with make install, the paths are set correctly for the premade StartupItem, which makes PostgreSQL start when you turn on your machine.

Furthermore, I created my own customized PHP-installation (5.1.2) using the following configure line:

./configure --enable-cli --prefix=/usr/local --with-pear --with-libxml-dir=/sw \ --with-apxs=/usr/sbin/apxs --enable-soap --with-pgsql=/usr/local/pgsql \ --with-readline=/sw --with-pdo-pgsql=/usr/local/pgsql --enable-pcntl \ --with-curl=/usr --enable-ftp --with-gd --with-png-dir=/sw --with-jpeg-dir=/sw \ --with-zlib-dir=/usr --with-freetype-dir=/usr/X11R6 --with-bz2

Use fink to install libxml2, libjpeg and libpng

Using the hints provided here, you'll get a configuration which makes working with the machine much easier for a UNIX/Windows guy. I hope it's of some use for you.

Read on →