FreePBX advanced configuration tutorials

I have set up basic PIAF/FreePBX system. Trunks, routes, extensions; even ring groups and queues. Everything works fine.
Now I am trying to set up something more complex. Let’s assume thatit is not possible through GUI (maybe I need to set up some variables; maybe call some functions or macros).
I look at this comment: That’s exactly my problem. Asterisk book tells a lot how to do things I want in Asterisk; but FreePBX adds another layer. What is the best way to learn advanced skills in PBX? Things that are at the intersection of some advanced configuration techniques and customization of Asterisk config files…

You need to pick up a copy of Asterisk, The definitive guide. All the programming applies.

For every Asterisk config file, FreePBX provides a custom file for your code. It’s a simple matter of passing control back to FreePBX with a goto statement.

If you need to hook into a dial plan segment that is part of the FreePBX config simply take a look the generated dial plan (diaplan show) and you will see all the custom and hook statements. Use those names in the custom config file and the FreePBX code will run your code at that point in the dial plan.

Read through our docs and wiki, we talk about FreePBX files.

Hope this helps get you on track.

Hi, Scott, and thank you for your response.

I don’t have a problem with the mechanics of setting up Asterisk. In fact I set up my first simple Asterisk system back in 2005, when there was no GUI available. Obviously, I have forgot most of what I did; but as I am moving along “Definitive Guide”, most of the things come back to mind.

Setting up Asterisk without FreePBX and setting up FreePBX is like writing a web page in HTML by hand vs writing in PHP. When you write by hand, you use some tricks to avoid excessive cut-and-paste; you put styles in a separate file; you may use some template. In PHP you write a PHP loop and you may generate a page with tons of pretty repetitive HTML output. (Obviously, the comparison only goes so far - but I hope you understand what I mean).

Similarly, in plain Asterisk you would use a lot more variables, Macro, and GoSub than in FreePBX; since FreePBX generates those conf files from PHP code. There is no downside to have this generated stuff repetitive - you are not going to modify it by hand.
That’s why Asterisk book (while undoubtably crucial for understanding any Asterisk implementation) only goes so far in learning how to implement advanced features of Asterisk in FreePBX environment.
PS. Just as I was writing this post, I was told that such documentation doesn’t exist. Oh well - there is always trial and error!

A good half way house (for me anyway) is to use something like Visual Dial Plan (VDP). This allows you to build custom dial plans by dragging and dropping dial plan elements into place and linking them. It also allows database linking with little hassle but works really well. It’s good to build dial plans which are pretty self documenting as well which helps when you come back to the in 4 years time to do some changes/maintenance.

It’s hard to comment further without knowing what you are trying to do. Usually “hooking” into FreePBX is just a matter of getting out of the generated dialplan, into your code then back again.