koolandrew Posted October 11, 2018 Report Share Posted October 11, 2018 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. Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted October 11, 2018 Report Share Posted October 11, 2018 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! Quote Link to comment Share on other sites More sharing options...
koolandrew Posted October 11, 2018 Author Report Share Posted October 11, 2018 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. Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted October 11, 2018 Report Share Posted October 11, 2018 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. Quote Link to comment Share on other sites More sharing options...
koolandrew Posted October 11, 2018 Author Report Share Posted October 11, 2018 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. Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted October 12, 2018 Report Share Posted October 12, 2018 For example you could use a expression like this: ^(01153[0-9]*|01154[0-9]*|01155[0-9]*)@.* The pattern can be expanded accordingly. Quote Link to comment Share on other sites More sharing options...
Support Posted October 12, 2018 Report Share Posted October 12, 2018 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. Quote Link to comment Share on other sites More sharing options...
koolandrew Posted October 13, 2018 Author Report Share Posted October 13, 2018 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. Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted October 14, 2018 Report Share Posted October 14, 2018 For fixed length patterns 1340xxxxxxx|1268xxxxxxx should work. Or (1340[0-9]*|1268[0-9]*)@.* Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.