Jump to content

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.


Link to comment
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.

Link to comment
Share on other sites


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.

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...