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-555-1234 and 770-555-5678 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 that do not meet the above requirements go to the softphone on my laptop on ext. 4005.


I haven’t tested this extensively, but I believe you can pattern match on the CID in inbound routes.

You do this by prefixing with an underscore _ then by using the same pattern matching as you would in trunks.

E.G. to match all UK calls put _44. in the CID entry in inbound routes.

You will need several pattern matches, and one blank one as a catch all.