Create a dialplan for multiple extensions

Suppose i have 20 random extensions say 1010, 1013, 1018, 2134, 4322, 1120, 3469, 3213 and so on. So now writing dial plan for them i have to write for all 20 extensions one by one like this.

exten => 1010,1,NoOp(Test call)
same => n,Dial(SIP/{EXTEN})
same => n,Hangup

exten => 1013,1,NoOp(Test call)
same => n,Dial(SIP/{EXTEN})
same => n,Hangup

exten => 1018,1,NoOp(Test call)
same => n,Dial(SIP/{EXTEN})
same => n,Hangup

and for 17 more extensions.

But i want to write the whole command in a single line like this

exten => 'all 20 extension here',n,NoOp(Test Call)
same => n,Dial(SIP/{EXTEN})
same => n,Hangup

Is this possible? If then how to achieve that?

This is well covered in the sample configuration, although the answer, in this case is “_10[12]X”.

However, making the extension name the same as the name of the device to which that extension connects, is considered bad security practice, because it allows an attacker to guess valid device names.

2 Likes