Hi Klaus,
What is your goal? Do you want to strip the extension till you get the "kopfnummer" (sorry, I do not know the english term)?
Maybe "base number" or something like that? Yes, that's exactly what I'm trying to find out. We've used a self-made lookup function until now, but in the course of the switch from SER to OpenSER I try to eliminate as much self-written stuff as possible for easier maintenance. I'm aware of the performance impact, but I'm currently just playing around with some stuff to see what's possible and maybe usable...
I know other which solve this problem by using a private ENUM tree with wildcard NAPTRs for the extensions which point to the "main URI".
We use a related approach in the e164.info tree. I'm quite curious about the performance of the different possibilities, so I find it rather interesting to compare these things in a test-bed...
Andy