Syntax to test for a number of caller ID's

Status
Not open for further replies.

toolfolks

Member
May 1, 2020
73
5
8
64
I am in effect trying to create a WhiteList of calls that will go directly to an extension.

In the DialPlan I have for 1 caller ID :

condition caller_id_number xxxxxxx
action transfer 1053 XML my.domain.com

I know I can repeat and add another for each but how would I do :

condition caller_id_number (xxxxxxx or yyyyyy or tttttttt)

Also which database table is this information stored in ?

I need to externally be able to update this list
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
If you update the table it will have no effect unless you instruct FreeSwitch to re-read the dialplan, this is normally done behind the scenes for you when you change dialplan detail in the GUI. It is achieved by a call to the Freeswitch event socket. There is a Fusion API that may be able to do this for you but is is only available to Gold members.

It sounds like this is a problem that would be better handled in an LUA script, that reads information from a table you could create for your purpose. FusionPBX uses a fair bit of LUA - something else for you to get your head around!

To answer your question the information you refer to is stored in v_dialplans and, but not necessarily, depending on your configuration, v_dialplan_details.
 

toolfolks

Member
May 1, 2020
73
5
8
64
Been looking at lua ( doesn't look too tricky).

Where do I add these magical scripts within the interface ?

Any tutorials ?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
They generally live in /usr/share/freeswitch/scripts, You write them in any text editor and put them in this directory. Make sure the are owned by www-data, the user that FreeSwitch runs as (chown www-data:www-data myscript.lua).

There are lots of resources on the internet about the LUA language, but probably the best tutorial is to look some of the existing scripts in that directory because they demonstrate the intraction with FreeSwitch, cidlookup.lua is a good simple example.

You can call LUAs from your dial plan with an action statement like:
acton lua myluasript,lua parameter1 parameter2 etc...

If the LUA returns a value, or sets channel variables, then the rest of that dial plan can act upon them.

Hope that helps.
 
Status
Not open for further replies.