Asterisk Parses Full Number as Extension

Hey fellows,

I encounter some strange behaviour by our asterisk PBX for some time.

Let me describe my Setup:

  1. We have the phone number (0049 as country prefix) (821 as area prefix) xxxxx00
  2. I have configured several SIP extensions in extensions.conf to be identified by two digits after the x00 in 1.

e.g. 0049821xxxxx0089 = Number is 0049821xxxxx00 + extension 89 (configured in extensions.conf)

example extensions.conf:

exten => s,1,WaitExten(10)
exten => 0,1,Set(CALLERID(number)=0${CALLERID(num)})
exten => 0,2,DIAL(SIP/1,20,r)
exten => 0,4,Hangup()

exten => 89,1,Set(CALLERID(number)=0${CALLERID(num)})
exten => 89,2,DIAL(SIP/89,20,r)
exten => 89,3,Hangup()

Some days ago I noticed that some extensions were not reachable for inbound calls.
I check the logs and see that ISDN receives the correctly dialed full number like 0049821xxxx30089
But asterisk tries to parse “xxxxx0089” instead of 89 only as the extension and can not find them.

So I had to change all entries in extensions.conf from the above to:

exten => s,1,WaitExten(10)
exten => xxxxx00,1,Set(CALLERID(number)=0${CALLERID(num)})
exten => xxxxx00,2,DIAL(SIP/1,20,r)
exten => xxxxx00,4,Hangup()

exten => xxxxx0089,1,Set(CALLERID(number)=0${CALLERID(num)})
exten => xxxxx0089,2,DIAL(SIP/89,20,r)
exten => xxxxx0089,3,Hangup()

First of all thats odd, second it’s configuration hell to keep those long numbers in extensions.conf.
Additionally some callers still can not reach some of my extension:
e.g. if they dial 0049821xxxxx0089 I only get 0049821xxxxxx00 on my ISDN redirecting it to the default “s extension”.

Maybe you can help me with my problem.

Thank a lot in advance.

With the DID’s you usually don’t have any other options then to define each one and define what happens with the call to that number. To simplify the inbound routes if you have the same call scenario on multiple DID’s, check out this link:

voip-info.org/wiki/view/Aste … n+Patterns

It appears to be working correctly now. I don’t understand what was stripping the rest of the number before.

Typically you would use wild card matches and substring ${EXTEN}. If necessary, you can have a first context that handles the full number and then GoTo’s a context with the prefix stripped off.