Wildcard at the beginning of a matching patter for CID (inbound route)

Dear all. I am seeking for a professional advice. I have a number of trunks from different providers. There is a need to catch a certain calls coming from all those providers by known CID, then to filter by DID and subsequently to route. The problem is that some calls come in as +7 XXX XXX XX XX ie + (plus)-area code- number, other calls do not contain + (plus) character, some calls from some providers have area code stripped as well so I see a bare number. Can I use a CID patter for my Inbound Route in this way _.2589764 where 2589764 is a bare number without + (plus) character and area code? My concern is that some calls still go to s exten of the delivered ext-did-0001 context. I cannot figure out why.
Thank you in advance.

There are so many things going on in your request that it’s really hard to understand what you are hoping to accomplish.

I’m going to pick the low-hanging fruit to maybe get rid of some of the confusion.

You can use a Custom incoming context to strip off “+” so that your inbound CID and DID numbers are consistent. From there, you can do a lot of different “slicing and dicing” to match or chop the numbers up to do things with them.

If, for example, you want to match a specific CID and DID on an inbound route, you can use a custom inbound route that formats all of your inbound numbers so that they match whatever number conventions you are using to match the CID and DID.

Hello Cynjut,
Thank you for your response. You are right, I definitely can catch all cases and strip off all redundant characters and numbers using power of dial-plan and Asterisk functionality. However, in my question I referred to the fact that I would prefer to use kind of a universal, all-purpose single line dial-plan code like _.2589764. The only thing that I am unsure if it is OK. I hope you are not trying to deny that single line code is a way better than multi-line one, provided that in both cases the goal is achieved. That is it.

Thank you.

Nope. There is no way to structure a dial pattern on an inbound route that will catch both cases.

Just to make it straight for me. You wont to say that _.2589764 will not match all of the following number combinations?:

It won’t match any of the number combinations. A ‘.’ character in Asterisk dial pattern speak means one or more of the preceding character, and can only come at the end of a dial pattern.

Understood. Thank you so much for responses and help. I think I have to follow Dave’s advise and to create a custom inbound route that formats all of my inbound numbers.

Thank you gentlemen.

1 Like