How to ban spammers with a regex?

Status
Not open for further replies.

manindersinghajimal

New Member
Oct 1, 2020
26
0
1
33
Hello All,

I hope you guys can help me as I am on my wit's end.

I have a fusionpbx installation running and its working as my main communication system. Now the problem is, my phone number are constantly bombarded by some spammer. Who wants to ruin my business (I suppose).

What I see is, that person has a supply of unlimited phone numbers but all the numbers are coming from same area code and country code.

Is there a way I can add a condition in the inbound route to reject a certain call that meets the regex?
This person is causing me really big mental and monetary harassment.

Any help will be much appreciated.

P.S. my genuine clients are only few everyday but these spam calls are like in hundreds.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Avoid doing too much in the inbound route. The inbound route is processed in the public context so anything you do there can affect all the domains.

The safest thing to do is create a destination in the dialplan manager and send the calls to it in the inbound route, just like you would transfer to an extension or ring group.

In the destination that you create you can then test for conditions and route the call accordingly. In the example below I test for the Caller ID Name being anonymous, but you could just as easy test for the first few digits of the Caller ID Number ^(1234\d+)$

This may give you some ideas anyway...

Screenshot from 2022-01-09 16-52-26.png
 

manindersinghajimal

New Member
Oct 1, 2020
26
0
1
33
Avoid doing too much in the inbound route. The inbound route is processed in the public context so anything you do there can affect all the domains.

The safest thing to do is create a destination in the dialplan manager and send the calls to it in the inbound route, just like you would transfer to an extension or ring group.

In the destination that you create you can then test for conditions and route the call accordingly. In the example below I test for the Caller ID Name being anonymous, but you could just as easy test for the first few digits of the Caller ID Number ^(1234\d+)$

This may give you some ideas anyway...

View attachment 2727I apologise, when I said inbound route, I meant inbound destination, if possible, please help me understand the anti action and can you show me the xml setup you point to in the image.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Yes, sure. The anti-action is what gets processed if the condition is not matched. In the example I gave 662 is where I want the unwanted calls to go - this could be anything you like, a recording, an extension with DND enabled, or a phone with the ringer turned off, or just a pain hang up. 690 is the ring group for my normal office phones.

This is the XML you requested:
XML:
<extension name="anonymous_check" continue="false" uuid="48794c29-ab47-4c5c-b9af-e6c2be4de845">
     <condition field="destination_number" expression="^671$"/>    <condition field="${caller_id_name}" expression="^anonymous$">
        <action application="transfer" data="662 XML tester3.a2es.uk"/>
        <anti-action application="transfer" data="690 XML tester3.a2es.uk"/>
    </condition>
</extension>
 

manindersinghajimal

New Member
Oct 1, 2020
26
0
1
33
Yes, sure. The anti-action is what gets processed if the condition is not matched. In the example I gave 662 is where I want the unwanted calls to go - this could be anything you like, a recording, an extension with DND enabled, or a phone with the ringer turned off, or just a pain hang up. 690 is the ring group for my normal office phones.

This is the XML you requested:
XML:
<extension name="anonymous_check" continue="false" uuid="48794c29-ab47-4c5c-b9af-e6c2be4de845">
     <condition field="destination_number" expression="^671$"/>    <condition field="${caller_id_name}" expression="^anonymous$">
        <action application="transfer" data="662 XML tester3.a2es.uk"/>
        <anti-action application="transfer" data="690 XML tester3.a2es.uk"/>
    </condition>
</extension>
I believe, I was not able to ask my question properly, I was referring to "690 XML tester3.a2es.uk" this xml. Or is this just something you entered?
 
Status
Not open for further replies.