Whitelist Only Phone Numbers

Status
Not open for further replies.

PBXMePlz

Member
Mar 1, 2019
102
10
18
31
I'm looking at playing with an option to whitelist only certain phone numbers, and hopefully have a relatively easy way to whitelist it.
I've been looking at call flows which would be great, but I only have true/false variable to play with.
It looks like I could maybe work on inbound routes, and set a condition for source possible.
Thoughts on how to best implement this?
 

jfoster911

New Member
Apr 16, 2019
4
0
1
I have created an inbound route for this (see below, sanitized).
It basically a IF-THEN-ELSE statement using the action and anti-action statements.
Key points are the <condition field="caller_id_number" expression="^(?:\+1|1)?(##########|##########|##########)$">
This does a REGEX lookup to see if the caller_id_number is authorized.
I'd like this to use LUA and a database lookup, although this would be a lot of programming to create.


<extension name="##########" continue="false" uuid="UUID">
<condition field="destination_number" expression="^(##########)$"/>
<condition field="caller_id_number" expression="^(?:\+1|1)?(##########|##########|##########)$">

IF-Then
<action application="export" data="call_direction=inbound" inline="true"/>
<action application="set" data="domain_uuid=UUID" inline="true"/>
<action application="set" data="domain_name=XX.XX.XX.XX" inline="true"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="transfer" data="########## XML XX.XX.XX.XX"/>
<action application="set" data="voicemail_action=save"/>
<action application="set" data="voicemail_id=##########"/>
<action application="set" data="voicemail_profile=default"/>
<action application="set" data="domain_name=XX.XX.XX.XX"/>
<action application="set" data="domain_uuid=UUID"/>
<action application="set" data="send_to_voicemail=true"/>
<action application="lua" data="app.lua voicemail"/>
<action application="hangup" data=""/>

ELSE
<anti-action application="set" data="voicemail_action=save"/>
<anti-action application="set" data="voicemail_id=##########"/>
<anti-action application="set" data="voicemail_profile=default"/>
<anti-action application="set" data="domain_name=XX.XX.XX.XX"/>
<anti-action application="set" data="domain_uuid=UUID"/>
<anti-action application="set" data="send_to_voicemail=true"/>
<anti-action application="lua" data="app.lua voicemail"/>
<anti-action application="hangup" data=""/>
</condition>
</extension>
 
Status
Not open for further replies.