We need to add functionality to our current Asterisk system. Now it works as a gateway - accepts calls via SIP trunk and forwards them to another IP using SIP protocol. It is managed via FreePBX web based interface. We need additional custom FreePBX module programmed to do called number lookups into Number Portability database.
More details in the file attached.