My suggestion would be to use the following dialplan:
exten => s,1,NoOp()
same => n,GotoIf($["${CALLERID(num)}"="1000"]?true)
same => n,GotoIf($["${CALLERID(num)}"="2000"]?true)
same => n(false),NoOp(False)
same => n,Hangup()
same => n(true),NoOp(True)
same => n,Hangup()
exten => 1000,1,NoOP()
same => n,Answer()
same => n,Set(MyNumber=2000)
same => n,NoOP(MyNumber is ${MyNumber})
same => n,ExecIf($[${MyNumber}:“1000|2000”]?Playback(demo-congrats)
same => n,Playback(goodbye)
same => n,Hangup()
The string resulting from expanding variables and functions, within the square brackets is rescanned as an expression, and a numerical value is generated, as a string (and which you can see in the verbose log, for the outermost expression). If that string isn’t 0, the true branch is taken.
Assuming curltmp contains xyzza, the initial substitutions result in: