Asterisk Dial Plan CompilerWelcome to the Asterisk Dial Plan Compiler Home Page. Here you can find any information related to this program. What is the Dial Plan Compiler?This program lets you use a different syntax to program
Asterisk dial plans
without having to number each line, using references instead. This way,
if you insert or delete or move lines around inside an extension, you don't
need to double check every reference you had in every You don't have to learn yet another language or anything. There are only minor differences between the Asterisk dial plan code and the Dial Plan Compiler code; mainly, that you only type the extension number once, including its context, and below it you put all your dial plan code, without line numbers and without repeating the extension in every line. Any reference to another line in the same extension or in a different one, is made with a simple syntax that points to a label instead of a line number. You have to mark the destination line with the same label, and when you compile your code, all that will be replced with the correct line numbers. Here's an example of a simple source file for DPC: X:example:501 ; some comment for the extension SetVariable(value=10) Answer L:enter-pin:Read(pin,enter-pin,4) GotoIf($["${pin}" = "1234"]?(L:ok)) ; goto label "ok" playback(incorrect-pin) Goto((L:enter-pin)) L:ok:playback(ok) Goto((L:number:599)) Hangup X:example:599 NoOp(The password was correct) L:number:Read(number,enter-number,7) Dial(${number}) OK, so what do I need to run it?The compiler is written in Java 1.4.2, but it only uses very basic classes so it might run on Java 1.3.1 although I haven't tested it there (and we're already on version 1.5 so maybe it's time to upgrade your runtime anyway). Of course you only need the JRE in the machine where you run the compiler, you don't need the JRE in the machine that runs Asterisk for this. Remember, this is only a compiler for complex dial plan files. I decided to write it in Java for two reasons:
UsageFor the moment, the compiler is just a command-line program. I am thinking how to add an optional GUI, in case it's necessary, but being a compiler, a command line should be enough... Suppose you have downloaded the jar file into
That's it. The compiler reads If the compiler finds any references that cannot be resolved it will warn you. Future plans
|
|