This scripts can be used in Lync Server or Skype for Business Server 2015 and allow to block PSTN calls based on the BlockedTelephoneNumbers.txt file, here is an example:
Phone,Action
01234567890,block
01234567891,block
01234567892,block
The instalation steps can be found here:
Blocking Calls on Lync Server and Skype for Business Based on Caller ID
https://uclobby.com/2014/07/31/calleridblock/
Changelog:
v1.2 - 2017-02-08:
Added Event Viewer log setting
v1.1 - 2016-10-04:
Remove the full path reference for BlockedTelephoneNumbers.txt file;
Modified the SIP Request Filter to only process INVITEs.
v1.0 – 2014-07-31:
Initial release