Block incoming call from specific extension using chan_pjsip (Asterisk 16))

Hi, i’m new to Asterisk. I’ve run Asterisk 16 on Ubuntu server using chan_pjsip

I want to block call from specific extension, for example :
9001 can’t receive call from 9002,9003 and 9004
but 9001 can call to 9002, 9003 and 9004

This my extension.conf configureation :
[from-extensions]
; Extensions
exten => 9001,1,Gosub(dial-extension,s,1,(User1))
exten => 9002,1,Gosub(dial-extension,s,1,(User2))
exten => 9003,1,Gosub(dial-extension,s,1,(User3))
exten => 9004,1,Gosub(dial-extension,s,1,(User4))

[dial-extension]
exten => s,1,NoOp(Calling: ${ARG1})

exten => s,n,Set(JITTERBUFFER(adaptive)=default)

exten => s,n,Dial(PJSIP/${ARG1},30)

exten => s,n,Hangup()

exten => e,1,Hangup()

I browse the tutorial on google but i can’t found for chan_pjsip
I need a guide or example script base on my existing configuration

Start by evaluating ${CALLERID(num)} variable and writing your conditional statement on a gosub to avoid code a repetition

I’m sorry, i don’t get it what you mean