Set dial plan for extension to extension calls

For our internal predictive dialer testing, I have set up a dial plan that allows extension to extension calls. The dial plan is working fine but it is kind of brute force.

[some context]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,Hangup

[i]exten => 1000,1,Log(NOTICE, “call 1000”)
exten => 1000,n,Dial(SIP/100,120,Tt)


exten => 1020,1,Log(NOTICE, “call 1000”)
exten => 1020,n,Dial(SIP/1020,120,Tt)[/i]

The problem is that I have to repeat the above section for each extension defined. So if I add a new extension, I have to change this configuration file and restart asterisk service.

There must be an easier way to specify the Dial function, such as Dial(_X). I’m sure for your experts there it should be pretty easy to set up.

Thanks in advance.

This should have been on Asterisk Support.

You don’t need to do a restart to make a dialplan change effective; dialplan reload is sufficient.

There are several examples in the documentation (the sample configuration files) of how to parameterise the extension number into the dialed address.

However, note that making the dialed address be the same as the extension number violates the security guidelines, so you should repeat the line that map one to the other for each extension, or use Astdb or another database to translate, or even derive one from the other algorithmically, and cryptographically, although any one to one mapping denies the flexibility of device names and extension numbers not being the same.

I think this kind of messages are just spam to promote the URLs in it(Oh the irony my signature).

Hah. :smiley: I try to trap those; I’m not totally sold on this one, so we’ll let it play out and see what their next post is about.