After some time using Bing I have manged to do this. Thanks to :
I wanted the caller that is blocked to get a announcment.
Step 1. Install Microsot Lync Server 2010/2013 SDK.
Step 2. Create a announcement using new-csannouncement.
New-CsAnnouncement -Identity “Applicationserver:server.contoso.com” -Name “NumberBlocked” -TextToSpeechPrompt “Sorry, Your call has been restricted” -Language “en-US” -whatif
Step 3. Create a unassigned number entry in Lync CP. I used +4787654321 as an example. assigning the announcement from step 2
Step 4. Create a BlockedNumbers.txt file on the Lync FE server share. Adding numbers and action ” +4712345678,block”, one on each line.
Step 5. Add the block/reroute script to “C:\Program Files\Microsoft Lync Server 2010\Server\Core”. Called my scripte CallerIDfilter.am (attached file) Remember to edit the file. Replace entries with your unassigned number,fileshare and domain in the manifest part and contact entry.
Step 6. You could run the “compilespl.exe CallerIDFilter.am” to validate that it does not contain any compilatio errors.
Step 7. Register the CallerIDfilter.am with the lync pool. :
New-CsServerApplication -Identity “registrar:lyncpool.contoso.com/CallerIDFilter” -Uri http://www.contoso.com/CallerIDFilter -ScriptName “CallerIDFilter.am” -Critical $False -Enabled $True -Priority 2