Jump to content
Vodia PBX forum
koolandrew

International Calling, Block high toll countries only

Recommended Posts

I was wondering if someone could suggest how to put together a dialing plan for a number of specific country codes (ie Cuba, Somalia and other scam country codes) and block them.

We use 011 for international calling, however the country code length differs (ie 2 or 3 digits) and the number of local calling digits differs greatly  (minimum of 5 and max of 15 according to what i think i read from the ITU)

I can do it easily for unwanted 1+ dialing as 10 digits easily follow, and just use XXXX. What i dont know how to do it set it up so the NOT ALLOWED list are only calls to those specific country codes, unless i do a separate entry for each country code, which becomes unwieldly.

I dont even need a replacement value as they are simply NOT ALLOWED.

Any and a quick response would be kindly appreciated.

A sample below is what i have tried but it doesnt work, as sometimes i can get it to block a Cuba call, for example, but every other international destination starting with 5.

international_dialcode_block.PNG

Share this post


Link to post
Share on other sites

I would just make one entry per country, as simple as 01153* and then block that entry. If you have a lot of them, it is easier to use the text mode. This makes it very fast to copy & paste lines. Extended regular expressions and even complex "simple" expressions easily get out of control!

Share this post


Link to post
Share on other sites

I have 90 of them, and they are at the top, so that it makes management of everyday dial plan issues very cumbersone. I was hoping to put everything on one line.

Share this post


Link to post
Share on other sites

At least make them easier to read... [] means either character listed there as far as I remember, if you want alternatives you need to use 01153|01154 not [01153]|[01154]. You should probably go for full extended regular expression, it is well documented and you don't need to try & error.

Share this post


Link to post
Share on other sites

thanks for the reply, where would i find that documentation. The issue with your suggestion is that it doesnt work if someone types in any more digits after 01153, as we would allow 011 calls to non prohibited countries, and 01153|01154 wouldnt block anything.  Please understand this is to prevent further hacking from non legitimate customers who have figured out to hack into the pbx and make calls. The issue is that each country is different for the amount of digits that are dialled after the country code, and some countries it is different length of digits within that country.

So i need something 011 (2 or 3 digit country code) (5 to 13 local number). And multiple entries per line .

 

Please advise.

Share this post


Link to post
Share on other sites

For example you could use a expression like this:

^(01153[0-9]*|01154[0-9]*|01155[0-9]*)@.*

The pattern can be expanded accordingly.

Share this post


Link to post
Share on other sites

Hi,

You can add the extra 2-3 digits after 01153/4 if you know what those digits are already to make sure the prohibited and non-prohibited countries remain as such. We would suggest that you should take the advantage of the text option and copy paste them instead of the extended regex anyway. 

You can find extended regex anywhere online. For instance we found one of them here: https://www.boost.org/doc/libs/1_64_0/libs/regex/doc/html/boost_regex/syntax/basic_extended.html hope this helps.

Share this post


Link to post
Share on other sites

Thanks for the update. The regex update might be a bit over my head.

I was able to get it to work without the ^.

i wanted to the same thing for Carribbean countries using the NANPA dialling plan, (ie 1340xxxxxxx 1268xxxxxxx etc, but i cannot apply the same logic.

Any ideas for that, as it is a little simpler as there are always 7 digits after the area code. I want to create a separate entry for those dial codes as i would like to treat them differently.

 

Thanks for all the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×