I'm looking for a way to look up a phone number and then prepending a prefix to the number then forwarding it to a host...


Basicly something like this

result=exec('/home/scripts/lookup.pl 800-555-1212')


               if(result)
                                # Lookup failed, assume that this is a phonenumber URL until I setup pattern matching
                                # Send to the TNT
                                xlog("L_INFO", "Sending URI (%ru) to TNT");
                                prefix(result);
                                rewritehostport("10.1.1.5:5060")
                        };



basicly then result would contain 333, or 555, or 777. Depending on then number that was returned from lookup.pl


is there anyway to do this? Or any other way to do it?

Thanks

Andrew