FusionPBX Anatomy

Status
Not open for further replies.

Neyamt

Member
Nov 12, 2021
52
5
8
29
Hello Everyone,

I need to know the overall anatomy of fusionpbx. I request from experts in this forum to share a documents or explain the anatomy of FusionPBX to understand how FusionPBX PHP code interact with lua scripts and how it create xml configuration dynamically on-fly and how freeswitch is configured to get that dynamic xml configurations.

thanks in advance.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
If you break this down into its fundamental component parts it is really quite simple. So here follows a VERY BRIEF explanation.

Correctly configured, FreeSwitch will will work perfectly well on it's own without FusionPBX, however FusionPBX adds extra features and the ability to configure FreeSwitch, so you don't have to.

The PHP code is mostly the web front end and you use this to enter your configuration data which gets stored in a database.

When a call or a registration request comes into Freeswitch, Freeswitch calls an .lua script that is known as an XML handler. This handler reads the database and dynamically generates the XML that Freeswitch needs to handle the registration or call.

And that's about it! Other lua scripts provide facilities like directory look ups or failure handlers that send a call to voicemail or forward the call if any kind of forwarding is enabled.

If you look in /etc/freeswitch/autoload_configs/lua.conf.xml you will see the lines:

Code:
    <!--
    Deliver XML from lua with the XML Handler
    -->
    <param name="xml-handler-script" value="app.lua xml_handler"/>
    <param name="xml-handler-bindings" value="configuration,dialplan,directory,languages"/>

This is how Freeswitch knows to use the lua scripts.

Freeswitch can get it's configuration with many different binding options, not just lua, you can view the Freeswitch lua binding documentation here:
https://developer.signalwire.com/fr...d-lua/Serving-Configuration-with-Lua_3965134/

I hope that helps you a little.
Adrian.
 
  • Like
Reactions: babak

Neyamt

Member
Nov 12, 2021
52
5
8
29
@Adrian Fretwell, thank you for replying.

It means, Freeswitch fetch its configuration data from PostgreSQL, using Lua Scripts and Fusionpbx create/read/update/delete the information of Freeswitch into PostgreSQL?

In addition, if you can help to understand how Fusionpbx generate xml configuration and how those xml files interact with freeswitch on-fly?

Thank you

1696606687501.png
 
Last edited:

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Yes, you have it pretty much correct.

The lua scripts that you will see in /usr/share/freeswitch/scripts/ following a FusionPBX install are part of the FusionPBX distribution not Freeswitch.

To understand how the xml is generated you will need to study the files in /usr/share/freeswitch/scripts/app/xml_handler. How they interact with Freeswitch on-fly is given in the signalwire link in my last post.

Adrian.
 
  • Like
Reactions: Neyamt
Status
Not open for further replies.