Check CID Against Two Sources

FreePBX/Asterisk 14

I have a customer request. They want to route calls based on if the caller ID shows up on a list that they are adjust periodically. The treatment has two checkpoints, for a total 4 different end destinations.

Essentially, the call comes in>List one check
IF true hang up
IF false continue

List two check
IF true, check if its a live person (press #)
IF false send the call to the extension

Has anyone done something like this? Is it possible to do this via a couple of list (maybe .csv or txt, just one field in the document) that they can upload to a specific folder on the server? I feel like this will be more practical for updating vs. the AstDB route. Of course any alternate ideas you guys can think of would be appreciated as well.

Thanks in advance for any insights!

How long are the lists? ASTDB will hold a lot of data and is relatively easy to search.

The rest is simply writing a custom inbound route. Not a huge challenge, especially you have all but the code for the context right here already.

1 Like

The concern with AstDB is updating it with new numbers. I want to make it easy for the end user to do it without me. Something benign, like saving a file to a folder on the server seems more manageable than having them run an update query.

Maybe it is in between, having them drop off a file to a folder, then running a cron to update AstDB.

That might work.

You can use a Google Spreadsheet and use a cron job that imports the data every few hours.

1 Like

That sounds like it might work for us. I’ll start Googling, but do you have any reference material that you might be able to point me to?

We did that once, I’m not at that at my computer now, but i would say you should start by googling ‘how to import data from Google Spreadsheet’ then you’ll have to write a script that does the import, once done, you can have a cron job that will run this script every few hours.
Of course that sheet will have to be shared publicly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.