[Freeswitch-users] Excluding phonenumbers from existing matches?

David Ponzone david.ponzone at ipeva.fr
Thu May 12 10:56:11 MSD 2011


Thomas,

Sure, you can't find a regexp to match a list of random numbers, as the whole point of a regexp is to match numbers which have some common part(s).
And also, the RegExp implementation in FreeSWITCH is not as complete as in the lib (named placeholders for example would be nice).

I think in your situation, you should go for the simplest/easiest.
Just add a condition before the one with your regexp, with break on-true:

<condition field="caller_id_number" expression="^03066664|0800330\d$" break="on-true">
 <action application="hangup"/>
</condition>
<condition field="caller_id_number" expression="^your regexp from hell$">
etc...

If you need to manage this blacklist from a DB, I would do something different:

<condition field="caller_id_number" expression="^your regexp from hell$">
 <action application="lua" data="validate-callerid.lua"/>
 etc....
</condition>

validate-callerid.lua is a rather easy to write LUA script, where you check the caller_id_number variable against your DB (one SQL SELECT) and if it matches, you can hangup or redirect the call to a message saying "Due to the past activity from your number, your calls to our system have been filtered".
If it doesn't match, you do nothing, and the dialplan will go to the next action, where your "bridge" is, probably.

You may rather call this LUA from a previous extension, quite early in the dialplan, if you want to drop the call ASAP and globally for all your platform.

David Ponzone  Direction Technique
email: david.ponzone at ipeva.fr
tel:      01 74 03 18 97
gsm:   06 66 98 76 34

Service Client IPeva
tel:      0811 46 26 26
www.ipeva.fr  -   www.ipeva-studio.com

Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.




Le 11/05/2011 à 23:45, Thomas Hoellriegel a écrit :

> Hi all, i have create a inbound dialingrestriction for the german landline numbers
> my expression:
> ^(0(?:2\d{3}|3[0-1,3-9]\d{2}|[4-6]\d{3}|7[1-9]\d{2}|70[1-9]\d{1}|
> 8\d{3}|9[1-9]\d{2}|90[1-9]\d{1})\d*)$
> 
> The problem: i cant.t exclude (blacklist) a number for examle:
> 03066664
> 0800330x
> or so on.
> I have many calls from callcenters. i must block numbers and ranges.
> I don.t find a reluar expression for allow al and deny limited numbers.
> Can your help please? thanks.
> 
> 
> 
> ---------------
> Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:
> http://www.blindi.net/callback
> homepage: http://www.blindi.net
> blinde-misc mailingliste für blinde. anmeldung unter:
> http://www.blindi.net/mailman/listinfo/blinde-misc
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110512/a8a6a02e/attachment-0001.html 


More information about the FreeSWITCH-users mailing list