Anonymous Call Rejection(I really need help)

I am trying to configure my extension file to send anonymous call or unknown calls, etc… to a special mailbox and telling the caller that I do not accept annonymous calls and can you please return your call with the callid available. And if there is a callid present, I would like to have the caller get connected to the person they are calling. I have been researching for the past 3 days without any real luck. This is my extension file so far.

exten => xxxxxx,1,Set(CallerIDString=${CALLERID(num})
exten => xxxxxx,1,GotoIf($[${CALLERID(NUM)}= “”] ? 3)
exten => xxxxxx,2,Dial(SIP/xxxxxx,60,tr)
exten => xxxxxx,3,Voicemail(uxxxxxx)
exten => xxxxxx,4,Hangup()

Any help would greatly be appreciated. My job kind of depends on this working. Please help if you can. My e-mail address if you need to e-mail me is Thank you again :question: :question:

you mean apart from the extension priority numbering being wrong ?

I think I made that mistake, but even by fixing that, it still doesnt work. Does anyone know the solution to this problem? Thanks again.

are you sure CALLERID(num) is empty ? put some NoOp() statements in to display the variable values, then post a log file fragment here.

also, why are you setting a new channel variable, then checking the output of the function ?

Also, there are more opening brackets than closing brackets in the above line. That can’t be good :smile: