i am exploring the Dynamic Routes Module
i get spam calls from callerid starting with a V followed by a string on numbers
the numbers following the V are different
is there a way i can use a regex expression to terminate these calls?
You can use dynroutes for this, but would need to chain them together, one for each regex making it impractical for more than a few.
I’ve done some tweaking of the superfecta trunk provided module for this use case.
Are you sure that the V isn’t a SHAKEN marker to indicate that the caller ID has been verified?
One solution is to verify against google’s libphonenumber, it has been implemented in many languages, I use
It can among other things
- Parse, format, and validate phone numbers for all countries/regions of the world.
-
getNumberType
- gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP, Personal Numbers, UAN, Pager, and Voicemail (whenever feasible). -
isPossibleNumber
- quickly guesses whether a number is a possible phone number by using only the length information, much faster than a full validation. -
isValidNumber
- full validation of a phone number for a region using length and prefix information. -
PhoneNumberOfflineGeocoder
- provides geographical information related to a phone number. -
PhoneNumberToCarrierMapper
- provides carrier information related to a phone number.
To normalize to e164 format strip all but digits, then if it isn’t 10 digits long , prepend ‘+1’ if it starts with your locales international dial , strip that and predend ‘+’, then pass the number to it.
In this case the number fails for Multiple reasons,
.
41 is Switzerland
60 is not valid in Switzerland
it is too long for Switzerland
International calls as yet wont get attestation and V is easily added to a CallerID by very much unValidated callers.
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.