Archive for April, 2007

Recover documents from a corrupt Lotus Notes database

Thursday, April 12th, 2007

Today when I was reading an IBM RSS feed about Lotus Domino, I stumbled upon an interesting technote on how to recover documents from a corrupted Lotus Notes database. The technote first recommends you attempt the standard fixup, updall and compact. However if those don’t work, this is something else to try.

The process recommended is to write an agent that will attempt to copy each document in the database to a new database. The technote has sample code that you could easily copy and paste with only a couple of tweaks to the filenames. I have never had a database that needed this but being prepared could come in handy in an emergency.

Asterisk caller id lookup via LDAP to a Domino Directory

Thursday, April 12th, 2007

I got an idea last night to have Asterisk do a LDAP lookup to a Lotus Domino Directory for caller id names. This provides caller id names for any company phone number listed in the directory including people’s cell phone numbers. Today I spent a few of hours writing a shell script to be called via the Asterisk Gateway Interface(AGI). The AGI is very powerful with interfaces to many programming languages like PHP, Perl, Python, Ruby and shell. There are many examples on the voip-info.org wiki.

The shell script is called via the Asterisk dialplan on incoming calls. The shell script get passed all the standard AGI variables which includes the caller id number of the caller. The script requires OpenLDAP to be installed on the Asterisk server because it uses the ldapsearch function. The script builds a LDAP search filter and queries the LDAP server for any users with a matching phone number. It then sends a “set callerid” command via the AGI to add the name to the call.

Domino’s LDAP server seems to respond very fast and the script takes around 1/4 of a second to process. I don’t consider script to be done and still needs more error checking added. I figured I would post what I have so others can build off of what I have started. Here are some instructions if you want to use what I created. The Asterisk server I was using is running 1.4.2 . I think it will work fine with prior versions of 1.2.x, however I have not tested it on that.

  • Download Asterisk AGI script.
  • Rename the file ldaplookupphone.agi.
    mv ldaplookupphone.txt ldaplookupphone.agi
  • Put it in the /var/lib/asterisk/agi-bin directory.
    mv ldaplookupphone.agi /var/lib/asterisk/agi-bin/"
  • Make sure the asterisk user has execute permissions on the script.
    chmod 755 /var/lib/asterisk/agi-bin/ldaplookupphone.agi
  • Update 3 variables at the top of the script for the hostname, username and password for the LDAP server.
  • Follow the example below to alter your extensions.conf to run the script before calling the Dial application. After you make changes in extensions.com remember to run dialplan reload at the Asterisk console.

Here is an example dialplan.
exten => 1234,1,Dial(SIP/1000)

It should be changed to look like this.
exten => 1234,1,AGI(ldaplookupphone.agi)
exten => 1234,n,Dial(SIP/1000)

In the future I hope to post other ways to do lookups to Lotus Notes databases from Asterisk AGI scripts.

Beryl

Saturday, April 7th, 2007

I have been using Beryl for about two months. Beryl adds OpenGL effects to the desktop; similar to Areo Glass on Vista. From what I have seen in Vista, Microsoft keeps the effects to a minimium. Beryl effects are much more aggresive and very noticable. Beryl does not add any productivity value to the computer but it makes it look much nicer.

Beryl runs well on my laptop and other slower CPU machines. Most of the processing is done on the video card instead of the processor so it does not pull resources away from the CPU. There are many demo videos on YouTube showing Beryl. Here is a good one that shows many of the effects.

The only issue I have been having with Beryl is that it does not yet support two monitors. My main workstation has two monitors and anytime I enable Beryl on it, I get unpredictable results. Every time it is unusable. I typically have to log in on a terminal and kill any Beryl related process to make my desktop usable again. Other than that it works great and I recommend you try it out.

Here is a link to the install guide for Beryl on Gentoo.