Incoming Caller ID Routing

I setup Trixbox 2.2 with TDM400 card. The TDM400 card has 1 fxo port and 1 fxs port. I have 2 extensions in my setup. One extension (ext. 4000) is going to an analog phone using the fxs port on TDM400. And another (ext. 4005) is a softphone on my laptop using x-lite. There is only one incoming PSTN line coming in on the fxo port on TDM400.

What I want to do is if a call comes in from certain area codes or certain phone numbers then go to the analog phone on ext. 4000. For example, if a call comes in from area codes 212, 917, 973 or 972 or phone numbers 201-123-4567 and 770-123-4567 then go to the analog phone on ext. 4000. Is there also a way to add international phone numbers to the list. For example, if I want to have a phone number from London +44 20 88963333 to go to the analog phone on ext. 4000. All the rest of phone calls go to the softphone on my laptop on ext. 4005.

The code below will examine the caller id starting a position 0, i.e the beginning, and take the first two (second parameter) and check for a match.
If true, it will jump to priority ten

exten => s,n,gotoif(${CALLERIDNUM:0:2} = 44]?10) ; UK area code set

regards