[asterisk-users] alphabetical extension patterns

Anselm Martin Hoffmeister anselm at hoffmeister-online.de
Thu Sep 6 03:21:35 CDT 2007


Am Donnerstag, den 06.09.2007, 10:16 +0530 schrieb Benjamin Jacob:
> Hello ppl,
> Any way to specify alphabetical exten patterns in the dialplans on Asterisk?
> All my users would have alpha/numerical ids. I don't want to add a line 
> for every user  in my dialplans.
> I searched around, but couldn't get anything useful. Any way to get 
> around this?

As from the docs, you can use letters in brackets, like

exten => _[ABC][DEF].,.....

>From my config I will give you an example of using names for extensions.
In my case, this is only used for incoming external SIP calls, so that
the extensions on my asterisk can be dialled as sip:username at hisdomain
from the internet.

Regular internal extensions are defined in my context [localdialplan],
my Asterisk DB contains several lines like

callroute/names/anselm = 201
callroute/names/flo = 212

8<=== extensions.conf
;* Look up exten in database
exten => _...,5,Set(A=${DB(callroute/names/${EXTEN})})
exten => _...,6,GotoIf($["A" = "A${A}"]?900)
exten => _...,7,Goto(localdialplan,${A},1)

exten => _...,900,Congestion()
===>8

(you'd need a bit more intelligence for more than one domain, but I
guess that is not what you think of right now)

HTH
Anselm




More information about the asterisk-users mailing list