FreePBX architecture

Hello guys,

I have been working with Asterisk for many years but just started looking into FreePBX for one of my work.
Basically I am interested in knowing FreePBX core architecture, how it interacts with Asterisk and Database.
I did search on forum and found this post where tonyclewis said

FreePBX writes everything to a database tables. Then when you run the Apply Config from the GUI it takes everything in the database, writes out .conf files and reloads asterisk.

Is there any other details available on architecture other than this?

Thanks,

P.S. I’m a new user and hence not allowed to put any link in my post.

New to the team and project, but this seems to be very much the case. I will say that the core of FreePBX is made up of many modules, each can be found in their own git repository. All of these modules are protected with signatures, so any updates needs to be signed to protect the module from being tampered with. It does take a bit of time to wrap your head around.

There are few other tools you can use defined here including dev tools:
https://wiki.freepbx.org/display/FOP/Setting+up+a+Development+environment+from+the+FreePBX+Distro

Module Signing:
https://wiki.freepbx.org/pages/viewpage.action?pageId=29753662

Big Module Object (BMO) is also something worth mentioning:
https://wiki.freepbx.org/pages/viewpage.action?pageId=19498386

BMO provides provides methods to install, upgrade, remove, backup, handle AGI, among other things for a module.

Thanks Matt,

Not exactly what I was looking for but those links are useful in other ways.

I’m not aware of any detailed documentation, but it is all open source. You could start by examining the code for a very simple Application, such as Misc Destination.

For links, I recommend putting them on a line by themselves, replacing the last for with %2E e.g.
www.example.com
becomes
www.example%2Ecom

On a mobile, this works as a link. On desktop, triple-click to select it, then right-click and choose Go to …

Can you be more specific in what you are looking for?
I spent over 5 years documenting development in FreePBX. It is all in the wiki.

Are you looking for how to recreate it?

Generate appropriate dialplan including AGI scripts. Use the asterisk manager interface for more direct interactions.

You can do these same things without BMO. The difference is that BMO introduced object orientated code into freepbx. Before you’d have to write procedural code to do install upgrade remove backup agi through functions.inc.php. The bad thing about functions.inc.php is that they are loaded for every module on every freepbx run (page laid. Scripts. Etc). Since BMO is object oriented that means it can take advantage of auto loading. So module functionality is only loaded when requested instead of each request. This means lower memory footprint and faster performance :slight_smile:

2 Likes

Thanks James,
Let me add some more details. As I have learned so far there are different components in FreePBX like Web interface, Asterisk(possibly AMI somewhere!), Database, some scripts running in background, etc…
I was interested in knowing how they communicate with one another and in which order.

Further, as tonyclewis mentioned here

FreePBX writes everything to database tables. Then when you run the Apply Config from the GUI it takes everything in the database, writes out .conf files and reloads asterisk.

Does FreePBX take all the configuration from the database and write to config files or just the part/s that has/ve been changed on GUI?

I had come across this wiki page, but it explains nothing about the components.

OT, I’m not a web developer and hence asking, is there any way to map FreePBX tables with GUI without going through PHP code?

That’s a great explanation Tom. I appreciate it.
I’ll dig deeper to figure out that from code itself.

Thanks again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.