FusionPBX is a WEB frontend for FreeSWITCH. It allows to do many things almost out of the box (don't take it wrong, it stills need configuration but you save time). FusionPBX as an in-app architecture that allows it to add different functionalities. These in-app are usually in the Advanced menu.
As I have already coding Billing for FusionPBX and RSVP for FusionPBX. I will share some of the know-how to do this. In this article, I will explain the anatomy of a basic in-app. This will help developers to do their own applications.
This file contains the basic manifest for the application. For example:
$apps[$x]['name'] = "Extensions";
$apps[$x]['uuid'] = "e68d9689-2769-e013-28fa-6214bf47fca3";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Used Configure SIP extensions.";
$apps[$x]['description']['es-cl'] = "Utilizado para configurar Extensiones SIP.";
$apps[$x]['description']['es-mx'] = "Utilizado para configurar Extensiones SIP.";
$apps[$x]['description']['de-de'] = "";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-at'] = "";
$apps[$x]['description']['fr-fr'] = "Utilisé pour configurer des extentions SIP";
$apps[$x]['description']['fr-ca'] = "Utilisé pour configurer des éxtentions SIP";
$apps[$x]['description']['fr-ch'] = "";
$apps[$x]['description']['pt-pt'] = "Utilizado para configurar extensões SIP.";
$apps[$x]['description']['pt-br'] = "";
Which they define the basic name, the application UUID and more related information.
This file contains the menu definitions. For example:
$apps[$x]['menu'][0]['title']['en-us'] = "Extensions";
$apps[$x]['menu'][0]['title']['es-cl'] = "Extensiones";
$apps[$x]['menu'][0]['title']['es-mx'] = "Extensiones";
$apps[$x]['menu'][0]['title']['fr-fr'] = "Extensions";
$apps[$x]['menu'][0]['title']['fr-ca'] = "Post téléphonique";
$apps[$x]['menu'][0]['title']['pt-pt'] = "Extensões";
$apps[$x]['menu'][0]['title']['pt-br'] = "Extensões";
$apps[$x]['menu'][0]['title']['pl'] = "Numery wewnętrzne";
$apps[$x]['menu'][0]['title']['uk'] = "Розширення";
$apps[$x]['menu'][0]['title']['sv-se'] = "Anknytningar";
$apps[$x]['menu'][0]['title']['ro'] = "Extensii";
$apps[$x]['menu'][0]['title']['de-at'] = "Nebenstellen";
$apps[$x]['menu'][0]['title']['ar-eg'] = "الأرقام الداخلية";
$apps[$x]['menu'][0]['title']['he'] = "שלוחות";
$apps[$x]['menu'][0]['uuid'] = "d3036a99-9a9f-2ad6-a82a-1fe7bebbe2d3";
$apps[$x]['menu'][0]['parent_uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55";
$apps[$x]['menu'][0]['category'] = "internal";
$apps[$x]['menu'][0]['path'] = "/app/extensions/extensions.php";
$apps[$x]['menu'][0]['groups'][] = "admin";
$apps[$x]['menu'][0]['groups'][] = "superadmin";
Please note you can add as many menus you want. You just need to be careful with the uuid (it should not be repeated) and to put the parent_uuid correct. In this case, bc96d773-ee57-0cdd-c3ac-2d91aba61b55 can be a constant for the parent menu.
There is no a standard for on this file. If you read the ones in the project, you will find it is not the same. This file contains actions that will make sure the correct configuration is done when installing from scratch. Some actions you may find are:
This file contains all the message traductions your application may use. Usually, it is like this:
$text['title-extensions']['en-us'] = "Extensions";
$text['title-extensions']['es-cl'] = "Extensiones";
$text['title-extensions']['pt-pt'] = "Extensões";
$text['title-extensions']['fr-fr'] = "Extensions";
$text['title-extensions']['pt-br'] = "Extensões";
$text['title-extensions']['pl'] = "Numery wewnętrzne";
$text['title-extensions']['uk'] = "Розширення";
$text['title-extensions']['sv-se'] = "Anknytningar";
$text['title-extensions']['ro'] = "Extensii";
$text['title-extensions']['de-at'] = "Nebenstellen";
$text['title-extensions']['ar-eg'] = "الأرقام الداخلية";
$text['title-extensions']['he'] = "שלוחות";
When all your definitions are done, you can do a reference in your files by using the $text array. For example: $text[title-extensions']. FusionPBX will choose the correct language based on your settings.
Happy coding!
blog comments powered by DisqusAbout
Read about IT, Migration, Business, Money, Marketing and other subjects.
Some subjects: FusionPBX, FreeSWITCH, Linux, Security, Canada, Cryptocurrency, Trading.