tag:blogger.com,1999:blog-2156539095375223979.post5784089378421378533..comments2024-03-20T03:35:01.157-04:00Comments on Ken's Unified Communications Blog: Blocking International Calls to Specific Countries in LyncKen Laskohttp://www.blogger.com/profile/14298995806059683301noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-2156539095375223979.post-91074588162034359682020-05-29T14:47:23.731-04:002020-05-29T14:47:23.731-04:00Here are my final versions of this. I wrote my own...Here are my final versions of this. I wrote my own NANPA filtering previously rather than using yours, and I missed a country or two as a result:<br /><br /># Microsoft Zone A countries only allowed for International Dialing<br />^\+(1(?!(24[26]|26[48]|284|34[05]|441|473|649|664|721|[67]58|767|784|8[024]9|86[89]|876|900|976))|7|27|3[0-469]|4[013-9]|5[25]|6[01456]|8[126]|91|35[12389]|372|38[56]|42[01]|852|886)(?:0)?(\d{6,14})(;ext=\d+)?$<br /><br /># Microsoft Zone A countries only plus:<br /># Costa Rica (506)<br /># Israel (972)<br />^\+(1(?!(24[26]|26[48]|284|34[05]|441|473|649|664|721|[67]58|767|784|8[024]9|86[89]|876|900|976))|7|27|3[0-469]|4[013-9]|5[25]|6[01456]|8[126]|91|35[12389]|372|38[56]|42[01]|506|852|886|972)(?:0)?(\d{6,14})(;ext=\d+)?$<br /><br /># Microsoft Zone A countries only plus:<br /># Costa Rica (506) & Israel (972)<br /># And less:<br /># Russia (7), Romania (40), Poland (48), Malaysia (60), Bulgaria (359), Estonia (372), Slovenia (386)<br />^\+(1(?!(24[26]|26[48]|284|34[05]|441|473|649|664|721|[67]58|767|784|8[024]9|86[89]|876|900|976))|27|3[0-469]|4[13-79]|5[25]|6[1456]|8[126]|91|35[1238]|385|42[01]|506|852|886|972)(?:0)?(\d{6,14})(;ext=\d+)?$<br />Doug H.noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-20018871596088546422020-05-27T16:57:10.410-04:002020-05-27T16:57:10.410-04:00I just realized that does not capture clamping the...I just realized that does not capture clamping the NANPA countries. Here is a version that clamps the NANPA countries and Premium numbers, except for Canada, the US and Puerto Rico. I am not sure if this will fit in Microsoft Teams though - it may be too long.<br /><br />^\+(1(?!(24[26]|26[48]|284|34[05]|441|473|649|664|67[01]|684|721|758|767|784|8[024]9|868|869|876|900|976))|7|27|3[0-469]|4[013-9]|5[25]|6[01456]|8[126]|91|35[12389]|372|38[56]|42[01]|852|886)(?:0)?(\d{6,14})(;ext=\d+)?$<br /><br />And here is a version with Costa Rica and Israel added:<br />^\+(1(?!(24[26]|26[48]|284|34[05]|441|473|649|664|67[01]|684|721|758|767|784|8[024]9|868|869|876|900|976))|7|27|3[0-469]|4[013-9]|5[25]|6[01456]|8[126]|91|35[12389]|372|38[56]|42[01]|506|852|886|972)(?:0)?(\d{6,14})(;ext=\d+)?$<br />Doug H.noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-58378752004109639102020-05-27T16:39:58.280-04:002020-05-27T16:39:58.280-04:00Yep, that looks good! I don't know which speci...Yep, that looks good! I don't know which specific countries are in Zone A, but I think you've got a good handle on it.Ken Laskohttps://www.blogger.com/profile/14298995806059683301noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-77791512547431009772020-05-27T16:27:41.730-04:002020-05-27T16:27:41.730-04:00How does this look for a Microsoft "Zone A&qu...How does this look for a Microsoft "Zone A" international dialing list, with NA Premium numbers blocked? I did positive tests for all countries on RegEx101.com, and negative tests against a couple dozen countries and all passed.<br /><br />^\+(1(?!(900|976))|7|27|3[0-469]|4[013-9]|5[25]|6[01456]|8[126]|91|35[12389]|372|38[56]|42[01]|852|886)(?:0)?(\d{6,14})(;ext=\d+)?$<br /><br />I may extend that list slightly yet, for example, Costa Rica, where Microsoft itself has support people, is not on the Zone A list.Doug H.noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-18495128212759028242020-05-27T14:30:34.323-04:002020-05-27T14:30:34.323-04:00Thanks for this! I had been having the thought sin...Thanks for this! I had been having the thought since I wrote my post, and now further since seeing your reply, that rather than implementing a block list, it may be easier to make an allow list. For example, allowing the Microsoft "Zone A" countries only. Also, I will need to combine that with your NA Premium rate filtering [(1(?!(900|976)] to become the new International rules.Doug H.noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-65038420308965420272020-05-26T10:56:13.995-04:002020-05-26T10:56:13.995-04:00Below is sample regex that contains every valid co...Below is sample regex that contains every valid country code in the world. With a bit of work, you should be able to modify it to only include the countries you want to allow dialing to:<br /><br />^\+(1|7|2[07]|3[0-46]|39\d|4[013-9]|5[1-8]|6[0-6]|8[1246]|9[0-58]|2[1235689]\d|24[013-9]|242\d|3[578]\d|42|5[09]\d|6[789]\d|8[035789]\d|9[679]\d)(?:0)?(\d{6,14})(;ext=\d+)?$Ken Laskohttps://www.blogger.com/profile/14298995806059683301noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-63042507504368743702020-05-26T10:43:01.718-04:002020-05-26T10:43:01.718-04:00I am implementing your dial plans for Teams. For ...I am implementing your dial plans for Teams. For international calling, I want to create a block list for a long list of countries (124) we never want to call. It is too long to fit into a single rule, so I can't just expand the International rule. Do you have advice on how to do this?Doug H.noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-24633076469415658522013-01-05T08:47:32.835-05:002013-01-05T08:47:32.835-05:00I think, but I am not sure, that
^\+(?!98|850)[2...I think, but I am not sure, that<br /><br /> ^\+(?!98|850)[2-9]\d{6,14}$<br /><br />should be<br /><br /> ^\+(?!(98|850))[2-9]\d{6,14}$<br /><br />You have already added those extra brackets in the other example patterns.<br />g1smdhttp://www.aa-asterisk.org.uk/index.php/Category:UK_Number_Plannoreply@blogger.com