We need 3 Lua script projects done. Can also be in XML if it functions the same way.
A. Caller ID Lookup & Caching. We are currently using freeswitch's CID lookup XML, however it is limited. I can only cache the CID lookup data for 28 days, and it caches to memcache. If you flush memcache, you lose the data. I want to instead read (and store) the CID lookup information for 60 days in a postgres database. Incoming calls that utilize CID lookup will first need to consult with this database to see if there is an entry younger than 60 days. If yes, use that data to set CID name. If not, contact the API for my CNAM provider, and store the info for future use.
B. Very similar to A. Prior to connecting inbound calls, we do a Spam lookup for the phone number with another provider. The provider returns a 404 if no spam found, and a 603 if that phone number is considered spam. Upload this info in the database, differentiate between the 603 and 404, and cache the results for 6 hours. Append the word "SPAM" prior to the caller ID name.
C. E911 Validation. The code should take the emergency_caller_id_number (if nil, use outgoing_caller_id_number) and verify that it is in the postgres database. If it is in the database, the phone call should proceed. If it does not exist in the database, the phone call should fail.
We already have a very simple script to do this with asterisk. I can show it to you so you get an idea of how to build it. Should be just as simple.