I’ve been able to use the Dynamic Routes module to route by looking at part of a Caller ID Name that I added using the Set CallerID module. I am wondering if there is a way to route using just the inbound Caller ID and see if there are keywords in the name, such as “medical”, “doctor”, or “lawyer”.
I don’t see a way to search an Asterisk Variable for a keyword to match. That is what I would like to do.
Does anyone know of a way to do this?
We did this using the Asterisk Phonebook and turing superfecta lookup on the inbound route. It would change the CallerID(name) to what was in the phonebook. We then had a custom context that looked at the Callerid(name) and routed based on the value.
I believe the phonebook is deprecating, so you might want to use the contact manager instead.
The above expression will catch inbound callers with CID names that have the words Medical, medical, Legal or legal and return a 0 or 1 based on whether there’s a match. You can use the 0 or 1 to branch the call in dynroutes.
Match returns 1:
Family Medical Center
family legal center
No match returns 0:
FAMILY MEDICAL CENTER
family center