My voip provider adds a 1 to all numbers coming in to my PBX. I have a script that removes the 1 from the CID and the DID, however if an anonymous call comes through it doesn’t process and just eventually hangs up on the person. Can anyone see what I’m doing wrong here?
I do something like that for the incoming on my system:
exten => s,n,NoOp( --- Check of the incoming number - START --- )
exten => s,n,GotoIf($[$["${CALLERID(name)}" = "Anonymous"] | $["${CALLERID(name)}" = "Unavailable"]]?s,setanonnum:) ; Is it a hidden number?
...
...
...
exten => s,n(setanonnum),Set(CALLERID(all)=${CALLERID(name)} <0000000000>) ; we gives it zero instead!
exten => s,n,Goto(s,check_end)
...
...
...
exten => s,n(check_end),NoOp( --- Check of the incoming number - END --- )
My phone company sends Anonymous or Unavailable when there is no number and/or name.
The … is lines with other things that I check for before I send the call to the phone!