Make your dialplan readable using priority labels
When you start asterisk or run ‘reload’ or ‘extensions reload’ from asterisk cli, the asterisk process will parse your /etc/asterisk/extensions.conf file and build a list of extensions with priorities starting with 1.
You can give any priority a name and make your extension file easy to write, read and modify.
Here is the syntax for each extension priority
exten => <extension_number>,<priority_number>(<label_name>),<application>(<application_data>)
You can then use the label number into a Goto application instead of an explicit priority number. You can then change your priority number, the label name will be the same and you don’t have to change all Goto places that point to that priority.
Example
exten => 5140000000,1,Noop(New caller from ${CALLERID(all)})
exten => 5140000000,n(playwelcome),Background(welcome-message)
exten => t,1,Noop(User didn’t enter anything… Retry…)
exten => t,n,Goto(5140000000,playwelcome)
In this specific example, the user is asked to enter an extension number. If you don’t enter anything
and reach the t (timeout) extension, we transfer again to extension 5140000000 at priority labelled playwelcome.
Comments
Leave a Reply