How to work with Elastix, PIAF, trixbox etc.


Visual Dialplan supports all major Asterisk PBX GUIs, including ElastixtrixboxPIAFAsteriskNOW and other.

You can simply create extensions, voicemail boxes and trunks using Elastix (trixbox, PIAF etc.) and then do all the dial plan magic with Visual Dialplan. This way you can develop dial plans using Visual Dialplan, leveraging all the benefits that come with its large component library including Lumenvox ASR components, Festival TTS components, validation engine, database support etc., and then deploy it directly to your Elastix (trixbox, PIAF etc.) server.

Dialplan deployment to Elastix from Visual Dialplan is simple as pressing at “Deploy” button.
It does not require additional work at Elastix side. There is no need to do any additional configuration at Elastix side nor update Elastix dialplan to make this work.
Visual Dialplan comes with integrated SSH client and will do the entire job behind the scene through SSH (write the dialplan to the Elastix server and then include it at appropriate places within the Elastix dial plan).

To develop Elastix dialplan with Visual Dialplan make sure to select Elastix for the “Asterisk server type” at “Preferences” dialog in Visual Dialplan.

This will instruct Visual Dialplan to deploy two files:

– globals_vdp.conf (where all the global variables will be stored) and
– extensions_vdp.conf file (where all the contexts and macros/subroutines will be stored).

It will also instruct Visual Dialplan to include these files at appropriate places within Elastix dial plan structure.
Visual Dialplan hooks in the extensions_custom.conf and globals_custom.conf files (standard Elastix files designed for the custom dial plan development). You can use this to override default behavior of the Elastix or to develop custom dial plan that will work together with the Elastix dial plan.

On the other side, Visual Dialplan will not change the configuration you did through the Elastix user interface but will rather add the call flow elements developed with the Visual Dialplan at appropriate places within Elastix structure without interfering with existing Elastix configuration and settings.

You also have to follow the Elastix contexts structure when developing the dialplan for Elastix:
– “vdp-outbound” context must be used to define outgoing call flows
– “vdp-inbound” context must be used to define incoming call flows


How to connect to Elastix (trixbox, PIAF, AsteriskNOW etc.)

1. Define the connection to the Elastix server
Visual Dialplan comes with integrated SSH client.
Type in the SSH access parameters at “Preferences” dialog and click on the “Test connection” button to test the connection with the server.
You should get the message that you established connection to the server.

Now you should click on the “Detect” button to detect the Asterisk server version.
You should get the message informing you about the Asterisk server version and appropriate version will be selected automatically from the drop down list.

Now select the appropriate type of your server (Elastix, trixbox etc.) from the “Asterisk server type” drop down list.


It is very important to set the appropriate type of the server (Elastix) in order to instruct Visual Dialplan to deploy the dial plan appropriately.

2. Read the server configuration data
Select defined server above at the “Select server …” drop down box to read the server configuration data.


Visual Dialplan will connect to the server and read server configuration data.
It will pre-populate library components with configuration data and later on validate the dial plan accordingly.


Note that Visual Dialplan will only read configuration data but will not change any of it.

3. Test your configuration
Now you are ready to develop your own dial plan but before you start modeling the dial plan it is our strong recommendation to test the Visual Dialplan and Elastix integration first.
To complete the test follow these simple steps:
– Open “Hello world” dial plan sample
– Select already configured server in the steps above
– Deploy the dial plan by clicking on the Deploy icon (or by selecting “Dialplan/Deploy” from the menu)
Hello world sample is very simple dial plan.
It will play the hello world message to the caller if the caller calls extension 56781.

Please make sure you hear the hello world message to confirm your installation is in place.


How to create and deploy dial plan

1. Create your dialplan
Now we are ready to proceed with the dial plan development.
Select ‘File/New Dialplan …’ and follow on screen instructions.

By default Visual Dialplan will create two contexts, vdp-outbound and vdp-inbound contexts:

– “vdp-outbound” context should be used to define outgoing call flows.
This context will be automatically included into the Elastix dial plan structure.

– “vdp-inbound” context should be used to define incoming call flows.
This context will be automatically included into the Ealstix dial plan structure.



1.1. Make sure to follow the default context structure.
– “vdp-outbound” context must be used to define outgoing call flows.
– “vdp-inbound” context must be used to define incoming call flows.
Otherwise the dial plan will not work as expected. Do not delete or rename these contexts.

Alternatively, you can create new context in the Visual Dialplan and then set it as the custom destination in the Elastix UI. This requires some work on Elastix side but it is quite simple (see below). For example you can develop custom-test context in Visual Dialplan and then instruct Elastix to send calls directly to that context by setting custom-test context as the destination in Incoming Route:

In order to define custom-test context in Elastix you need to login to the Unembedded FreePBX® GUI (FreePBX® is a Registered Trademark of Schmooze Com, Inc.):

Unembedded FreePBX® GUI login parameters are username:asteriskuser and pass:eLaStIx.asteriskuser.2oo7 (for Elastix)


Select Tools option and under the Tools select Custom Destinations option.

When making new contexts you must follow the naming convention:
The context name should start with ‘custom-‘ and be in format ‘custom-context,extension,priority’. For example ‘custom-test,s,1’.

And that’s it. Now just select custom-test context as a target from the drop down menu in Set Destination section in Incoming Route (see on the screenshot above).

Note that context developed in Visual Dialplan must have the same name like the context in FreePBX® (custom-test context in this example).

1.2. Make sure to start your dial plan with Extensions (not Start) block!
Traditionally in Elastix the call routes depending on the inbound route configured in Elastix with particular DID.
The same in Visual Dialplan – the call routes depending on the inbound route configured in Visual Dialplan with particular Extensions (DID=extension in Visual Dialplan) or in other words, the call routes depending on the call flow defined in vdp-inbound context.
The same for outgoing calls – the context that handles outgoing calls is vdp-outbound.

The context should be started with Extensions building block ( Image), NOT with the Start extension – ‘s’ ( Image) because the ‘s’ extension is handled by the Elastix server by default.
Double-click on Extensions building block and in the box put in the number you would have used as DID in Elastix’s inbound route. Then decide how you want that call to route, say to another context. When routing to another context, start that one with the “Start Extension” block.

You can use ‘catch all’ extension (“_.”) to override all inbound and outbound calling rules in Elastix or specific extensions (56781 or any other) to handle only those specific extensions.


1.3. Make sure to end your dial plan properly!

You should return the call back to Elastix to be routed further as defined by the PBX, after you finished with your custom dial plan, but you can also hang up the call.

If you want to return the call back to Elastix for further processing:
– for incoming calls use Goto component and send the call back to “ext-did” context (extension “EXTEN”)
– for outgoing calls use Goto component and send the call back to “outbound-allroutes” context (extension “EXTEN”),

To hang up the call use ‘Hang up’ component.

You can also start with one of the included samples.

2. Deployment
When you are satisfied with the dial plan simply click on the “Deploy” button or select “Dialplan/Deploy” from the main menu and the dial plan will be deployed to the Elastix server. No additional work at Elastix side is required.

Make sure you selected Elastix type of Asterisk server at preferences dialog before deploying the dial plan.


How to delete custom dial plan and return back

To return back to the Elastix default dial plan simply delete content of “vdp-outbound” and “vdp-inbound” contexts and deploy the dial plan. That way you will delete all the dial plan logic you did with Visual Dialplan and return back to Elastix dial plan.