Pattern matching on incoming DID

I have a provider that sends DID numbers within the US without the 1 prefix. So the numbers come in like this:
7815555555, I have setup ENUM and it sends the DID in as 17815555555. Is there a way to have pattern matching work where it looks for the absence of the number as well as the number? Right now I have 2 incoming routes for each number just to match this.
It seems that DID pattern matching can’t do this or am I missing something?

I have gone through a number of forum listings and nothing seems to indicate this is possible or not.

Thanks.

Philip

in my experience most US DIDs come in as 10 digits. There are a couple of options. If the DID is from a VoIP provider you may be able to use the register line to change what DID they send you with a “/1NXXNXXXXXX” at the end of the register line. Otherwise, you could normalize to always add the 1 by sending your inbound trunk to another context and prepending the 1 before sending it to the normal from-pstn area. Or, you can override the anonymous sip context and have it strip the 1.

I am trying to go the way of modifying the incoming DID from enum.

So I am trying to find what is the context that is used for anonymous sip.

I know what it is for IAX2 because I created that. But I don’t know what it would be for sip.

I ended up doing something different and this is what I did.

[from-pstn-custom]
exten => _1N.,1,Set(DID=${EXTEN:1}) ; Remove 1 from DID
exten => _1N.,n,Set(CALLERID(num)=${CALLERID(num):0}) ; Remove nothing from CID
exten => _1N.,n,Goto(from-trunk,${DID},1) ; Go to from-trunk

I then moved my inbound route for DUNDI into this context:

[ext-did-custom]
include => outrt-002-DUNDI_pstn

Actually that is where I should have put it in the first place.

So calls through all calls even enum are now normalized if they start with a one.

Thanks for the pointers.