FOP Under 2.5

I have been very happy using the FOP panel under all the versions prior to FreePBX 2.5. I have been able to manipulate the layouts so I can have up to 100 extensions showing, I moved the trunks, queues, and parking lots all the way to the right to make room for my smaller extension buttons. When an update that rewrote framework came out I just updated the op_buttons and op_style, along with the retrieve_op_conf_from_mysql files. Now it seems that all has changed. I see that the op_buttons is commented out and the info is auto generated in op_buttons_additional. I also note an additional set of commands in retrieve_op_conf_from_mysql. My problem is I can no longer manipulate these files. The retrieve_op_conf_from_mysql won’t let me change the rectangle size/locations, and even though I can take the entire op_buttons I designed and put it into op_buttons_custom, every time I make an admin change it rewrites it again. I also cannot move my smaller buttons over to make room for the 100 extensions I show on one page. What’s up? Where can I find these variables that force the change? I do not want to redesign every time I do a change in admin.

Do what I do and copy your modified files with a .bak extension like this:

cp op_style.cfg op_style.cfg.bak … do this for all your modified files and then create a script like this (mine is called

cp op_buttons.cfg.bak op_buttons.cfg
cp op_server.cfg.bak op_server.cfg
cp op_style.cfg.bak op_style.cfg
cp /var/lib/asterisk/bin/ /var/lib/asterisk/bin/
amportal restart

Then every time you update FreePBX you can run your script (./ and hey presto all fixed.


the following code is run in retrieve_conf after FOP has been changed:

<?php // run retrieve_conf_post_custom // If the following file exists, it will be run. This allows customization to be run automatically after the normal // processing. Caution should be taken using this as it is only deisgned for expert usage. Errors in the code will // have bad consequences and can cripple the system. // if (isset($amp_conf['AMPLOCALBIN'])) { $post_custom = $amp_conf['AMPLOCALBIN'].'/retrieve_conf_post_custom'; if (file_exists($post_custom)) { outn(sprintf(_("Found script %s, executing.."), $post_custom)); include($post_custom); out(_("OK")); } } [/php] also notice this after the reload process: [php] <?php if (isset($amp_conf["POST_RELOAD"]) && !empty($amp_conf['POST_RELOAD'])) { exec( $amp_conf["POST_RELOAD"], $output, $exit_val ); [/php] and before retrieve_conf is run: [php] <?php if (isset($amp_conf["PRE_RELOAD"]) && !empty($amp_conf['PRE_RELOAD'])) { exec( $amp_conf["PRE_RELOAD"], $output, $exit_val ); [/php] so there are multiple options. In the meantime, I know there are contributors looking at better ways to auto-generate but allow customization like we do in other parts of FreePBX. Feel free to join the effort and make some proposals that will help everyone and in the mean time, there should be enough hooks for you to automatically keep your system as you desire from the above options.

It seems that now in version 2.6 it is /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.php that is called
by free pbx reload to regenerate fop layout. This file plus some style files need to be modified. If new version of freepbx is installed retrieve_op_conf_from_mysql.php must be modified again or the old version copied back (not elegant solution).

It would be great if someone wrote freepbx module to manage flash panel, the above could easily be converted into a template number 2. (more extensions). Additional templates would be easy to implement.
If anyone was interested, we would be happy to contribute (financially & testing only - we are not developers)

Following are changes to make FOP layout of 60 extensions, more queues and less confence buttons.
We changed button size, fonts, scaled buttons to make them smaller and fit into smaller button size.

  1. Create backup copies of files:
    cd /var/lib/asterisk/bin/
    cp -a retrieve_op_conf_from_mysql.php retrieve_op_conf_from_mysql.php.bak
    cd /var/www/panel # we use debian, on centos it is /var/www/html/panel I think
    cp -a op_lang_en.cfg op_lang_en.cfg.bak
    cp -a op_style.cfg op_style.cfg.bak

  2. Make following changes to files (below is in unified diff format for easy patching)

asterisk2: /var/lib/asterisk/bin

diff -u retrieve_op_conf_from_mysql.php.orig retrieve_op_conf_from_mysql.php

— retrieve_op_conf_from_mysql.php.orig 2009-09-12 05:41:07.000000000 +1000
+++ retrieve_op_conf_from_mysql.php 2009-11-08 05:14:34.877145314 +1100
@@ -25,11 +25,18 @@

TODO - add support in this code and in “panel” database for a layout for each panel context (amp user)

structure is - ID, Legend, startpos, stoppos, color1, color2

-$rectangle1 = array(“trunk”,“Trunks”, 53, 80, “10ff10”, “009900”);
-$rectangle2 = array(“extension”,“Extensions”, 1, 40, “1010ff”, “99cccc”);
-$rectangle3 = array(“parking”,“Parking lots”, 49, 72, “ffff10”, “cc9933”);
-$rectangle4 = array(“conference”,“Conferences”, 45, 68, “006666”, “00a010”);
-$rectangle5 = array(“queue”,“Queues”, 41, 64, “ff1010”, “a01000”);
+#$rectangle1 = array(“trunk”,“Trunks”, 53, 80, “10ff10”, “009900”);
+#$rectangle2 = array(“extension”,“Extensions”, 1, 40, “1010ff”, “99cccc”);
+#$rectangle3 = array(“parking”,“Parking lots”, 49, 72, “ffff10”, “cc9933”);
+#$rectangle4 = array(“conference”,“Conferences”, 45, 68, “006666”, “00a010”);
+#$rectangle5 = array(“queue”,“Queues”, 41, 64, “ff1010”, “a01000”);
+#$rectangles = array($rectangle1,$rectangle2,$rectangle3,$rectangle4,$rectangle5);
+$rectangle1 = array(“trunk”,“Trunks”, 73, 120, “10ff10”, “009900”);
+$rectangle2 = array(“extension”,“Extensions”, 1, 60, “1010ff”, “99cccc”);
+$rectangle3 = array(“parking”,“Parking lots”, 70, 112, “ffff10”, “cc9933”);
+$rectangle4 = array(“conference”,“Conferences”, 68, 109, “006666”, “00a010”);
+$rectangle5 = array(“queue”,“Queues”, 61, 107, “ff1010”, “a01000”);
$rectangles = array($rectangle1,$rectangle2,$rectangle3,$rectangle4,$rectangle5);

$rectmarginx = 1;
@@ -42,9 +49,11 @@
$layoutbuttonsonly = 1;

######## BUTTON INFO #########
-$buttonsizex = 246; # 1+244+1 from information in op_style.cfg
+#$buttonsizex = 246; # 1+244+1 from information in op_style.cfg
+$buttonsizex = 164; # 1+244+1 from information in op_style.cfg
$buttonsizey = 28; # 1+26+1 from information in op_style.cfg
-$numbuttonsx = 4;
+#$numbuttonsx = 4;
+$numbuttonsx = 6;
$numbuttonsy = 20;
$buttonsoriginx = -1;
$buttonsoriginy = 32;
@@ -54,11 +63,18 @@

NOTE - These values may be overwritten by the syleinfo function with values generated from the layout info


asterisk2: /var/www/panel

diff -u op_lang_en.cfg.orig op_lang_en.cfg

— op_lang_en.cfg.orig 2009-09-22 05:17:10.759264000 +1000
+++ op_lang_en.cfg 2009-11-08 13:40:14.079388373 +1100
@@ -9,7 +9,8 @@
unreachable=Not reachable $1
lagged=Lagged $1
newold=New $1, Old $2
-waitingonqueue=$1 user$2 waiting
+waitingonqueue=calls: $1
+;waitingonqueue=$1 user waiting $2
memberonconference=$1 participant$2
version_mismatch=Client/Server version mismatch!
; client side

asterisk2: /var/www/panel

diff -u op_style.cfg.orig op_style.cfg

— op_style.cfg.orig 2009-09-22 05:17:11.027165000 +1000
+++ op_style.cfg 2009-11-08 13:36:58.164143690 +1100
@@ -31,7 +31,8 @@

; Settings for the button (rectangle)
@@ -42,12 +43,13 @@

; Settings affecting the button label
label_font_family=Verdana ; only valid when use_embed_fonts is disabled
label_extent_x=40 ; If the label does not fit horizontally, increase this number
@@ -55,58 +57,71 @@

; Settings affecting the button clid

; Settings for the timer

; Settings for the oval led

; Settings for the arrow

; Settings for MWI Icon

; Settings for icons






; Settings for Status Bar at the top

  1. Save changes in freebpx administration panel and reload freepbx, then refresh flash panel
    and new layout should now be in effect.