FreePBX-FOP Integration

Hi all,
My question is about how to modify FOP LAyout.
I colud do anything if I modify op_buttons.cfg and delete the inclusion of op_buttons_additional.cfg.

But if I wolud like to keep this inclusion, how should I arrange FreePBX in order to start to write buttons about trunks at the poit I want ?

To be more specific: my FOP should have ONLY Extensions and TRUNKS, equally sized. But the first trunk is always placed at offset 52, not 42 as I would like it were.
this is my op_buttons.cfg

{CODE()}
include => op_buttons_additional.cfg

; use this for your customizations to FOP
include => op_buttons_custom.cfg

; trunks
[rectangle]
x=492
y=32
width=491
height=564
line_width=0
line_color=10ff10
fade_color1=10ff10
fade_color2=10ff00
rnd_border=2
alpha=20
layer=bottom

; extensions
[rectangle]
x=-1
y=32
width=491
height=564
line_width=0
line_color=1010ff
fade_color1=1010ff
fade_color2=1010ff
rnd_border=2
alpha=10
layer=bottom

[LEGEND]
x=500
y=32
text=Trunks
font_size=18
font_family=Times New Roman
use_embed_fonts=1

[LEGEND]
x=10
y=32
text=Extensions
font_size=18
font_family=Arial
use_embed_fonts=1

{CODE}

and this is part of my op_buttons_dditional.cfg
{CODE()}
; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui
[SIP/2396]
Position=2
Label="2396 : First SIP Phone"
Extension=2396
Context=from-internal
Icon=4
Voicemail_Context=device
VoiceMailExt=*[email protected]
Panel_Context=default
[SIP/2411]


[SIP/8703901]
Position=24
Label="8703901 : Last SIP Phone"
Extension=8703901
Context=from-internal
Icon=4
Voicemail_Context=device
VoiceMailExt=*[email protected]
Panel_Context=default
[Zap/1]
Position=52
Label="Zap 1"
Extension=-1
Icon=3
Panel_Context=default
[Zap/2]
Position=53

{CODE}

Where this 52 is taken from , and how can I change this to 42 ?

Thanks in advance,
Andrea

I know exactly what he’s getting at…

  1. When you create or change things in freePBX like extensions or trunks, freePBX will automatically re-generate the buttons_additional config file for the FOP panel.
  2. There must be somewhere in the freePBX code that states static locations that it should place buttons for extensions, trunks, etc.
  3. FOP has positions 1-80 that you can place buttons at by default. freePBX starts it’s extensions at 52 when it re-writes the config file.

The question is, where is that variable stored, and can we change it in freePBX? It would be nice to have a config page for it, or at least a config file. The config file could be as simple as:

[foplocations]
extensions=02-40
queues=42-50
trunks=52-60,72-80
park=62-70

That way when freePBX goes to generate extensions_additional.conf it knows that it should place extensions starting at 02 through 40, and if it exceeds 40, to just truncate them.

It would also be nice to be able to specify

trunks=no

or something to turn off generation for that section. (We have 46 trunks that serve no purpose on the FOP panel).

Thanks!

The config file that freePBX uses to auto-generate the config for FOP is /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl

You can change the locations in the beginning of that script, then when you update freePBX config, it will place the buttons in the right locations.

Of course, when you update freePBX, you will have to re-do this…

thanks again for your answer.
I don’t want to change any style parameter: I only want to change the position of the buttons.
Buttons position are determined by a parameter present in op_buttons.cfg, specifically:

Position=XX

so if I:
merge the contents of op_buttons_additional.cfg into op_buttons.cfg
edit the resulting op_buttons.cfg
assign new position value to each button
delete op_buttons_additional.cfg
delete include statement for op_buttons_additional.cfg from op_buttons.cfg

I obtain EXACTLY what I want.

Unfortunately, if I create a new extension using FreePBX, I have to manually adjust op_buttons.cfg, creating a new button entry

This could be avoided, because FreePBX already provides a correct op_buttons_additional.cfg with the new button for the new extension, and kill fop and restart it.

Unfortunately the position parameter assigned automatically by FreePBX to op_buttons_additional.cfg buttons is not tunable by me: in the beginning of the op_buttons_additional.cfg file you see:

; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui

but in the web gui I cannot see the position parameter that will be assigned to each button.

[quote=“lanzaandrea”]Hi all,
My question is about how to modify FOP LAyout.
I colud do anything if I modify op_buttons.cfg and delete the inclusion of op_buttons_additional.cfg.

But if I wolud like to keep this inclusion, how should I arrange FreePBX in order to start to write buttons about trunks at the poit I want ?

To be more specific: my FOP should have ONLY Extensions and TRUNKS, equally sized. But the first trunk is always placed at offset 52, not 42 as I would like it were.
this is my op_buttons.cfg

[Zap/1]
Position=52
Label="Zap 1"
Extension=-1
Icon=3
Panel_Context=default
[Zap/2]
Position=53

{CODE}

Where this 52 is taken from , and how can I change this to 42 ?

Thanks in advance,
Andrea[/quote]

OK the 52 you appear to be referring to seems to be the order the extensions / trunks are displayed in… also you cant modify this file since it is erased and recreated each time… Not really sure what you are trying to do… If you are trying to change the way the FOP sorts the extensions / trunks, it cannot be done by modifying the config file. If on the other hand, you are trying to move the placement of the groups, you can do that using this file. the “x” is pixels left and right on the display, and the “y” is the pixel offset up and down. the width and height are exactly what they appear to be (in pixels) - roughly, eight pixels is about the width of one character (ie to move to the left 2 characters, subtract about 16 from the “x”).

Not sure what you are actually trying to do, perhaps a more concrete example in “baby terms” might describe it.

Just a guess here but maybe read the docs for the app in question
http://www.asternic.org

I wasn’t able to find the answer there.
Obviously I searched there before posting here.
Also I post a question there last week, with no answer.
I think this is a FreePBX issue, not FOP: it’s the way FreePBX creates _additional file the problem (actually it is not a problem),
not the needed syntax

If you could be more specific about where to search on the asternic site…

thanks,
Andrea

You wish to change the look of FOP right (sorry As I do not use FOP I really am guess at what you hope do)

THe doc on the site tell you all about the app.

Changing the layout
Edit op_style.cfg to change the visual layout. You can change the button size and colors, icon placement and size, etc. DO NOT modify the variable names, just the value after the equal sign and DO NOT use spaces. With proper adjusting, you can have more than a 100 buttons on the screen.

The variable names are self explanatory. For example, if you want to reduce the height of the buttons, just set btn_height to a lower value.

You can change this file with the op_panel.pl running. After changing a value, you must tell the server to refresh the configuration by sending a HUP signal (killall -HUP op_server.pl). After that, you need to reload the flash display, by clicking the reload button or just reloading the page.

You can change the toolbar layout by changing the number after the variables show_???. Each one represents a possible element in the toolbar.

show_security_code Security Code input box
show_clid_info Extra Info in CLID box
show_btn_help Help button
show_btn_debug Debug button
show_btn_reload Reload button
show_status Status Bar

Ok, That works great on Freepbx 2.2 but I now have upgraded to 2.3. Changing that file seems to do nothing to the FOP. Has the active file changed? This is what’s keeping us from upgrading to 2.3.

John

Other than upgrading to a slightly newer version of FOP in 2.3, the rest of it is the same. Some styling changes in the default FOP style configuration to match a similar color scheme and that is about it.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

A really great feature would be to automatically populate the number of buttons based on the maximum channels allowed on the trunk. Unrelated comment, sorry.

Rob

ip-rob,

It already does this. The issue is that the dedicated space it assigns for the buttons is to small if you happen to have a lot of trunks and/or a PRI. then you need to modify some settings which even the origional developer has not had time to address. When there are more buttons then space it fills the space then starts over, basicly stacking buttons one on top of the other so it looks like they are not there but are and the last one to have activity is updated displaying on top of the others.

Hi,
To make the customization in the FOP you can go through the post “Remastering Asterisk Flash Operator Panel” at http://noviceoracle.blogspot.com. It is having all the details and information to change the FOP

open the following file in
"/var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl"
and change the following

######## STYLE INFO #########
$extenpos=“2-40”;
$trunkpos=“52-60,71-80”;
$confepos="";
$queuepos=“42-50,61-70”;

to

######## STYLE INFO #########
$extenpos=“2-80”;
$trunkpos=“92-100,111-120”;
$confepos="";
$queuepos=“82-90,101-110”;

and run the command to rebuild the file
/var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl

I’m using asterisk 1.4.20 and FreePBX 2.5.0 I’m facing almost same issues like I have more than 40 extensions and all i see at FOP screen is overwritten extensions from start.I read the whole thread and found out to change the file /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl So i did tried to play abit with it but in vain. Please can anyone tell whats need to be done in order to get my FOP working fine…
As a suggestion I think that in FOP screen we should only display the extensions which are registered in the system.Whenever someone registers their SIP account FOP should put his extension/name in the list. This maybe hectic job for the developers but this will really reduce these problems.Not all of the people stay registered every time so Offline dudes just consume space at FOP. did someone get the idea?

here is the file i edited:

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

@rectangle1 = (“Trunks”, 53, 80, “10ff10”, “009900”);
@rectangle2 = (“Extensions”, 1, 40, “1010ff”, “099cccc”);
@rectangle3 = (“Parking lots”, 49, 72, “ffff10”, “cc9933”);
@rectangle4 = (“Conferences”, 45, 68, “006666”, “a01000”);
@rectangle5 = (“Queues”, 41, 64, “ff1010”, “a01000”);
@rectangles = (@rectangle1,@rectangle2,@rectangle3,@rectangle4,@rectangle5);
######## BUTTON INFO #########
$buttonsizex = 246; # 1+244+1 from information in op_style.cfg
$buttonsizey = 28; # 1+26+1 from information in op_style.cfg
$numbuttonsx = 4;
$numbuttonsy = 20;
######## STYLE INFO #########
$extenpos=“2-40”;
#$trunkpos=“52-60,71-80”;
#$confepos="";
#$queuepos=“42-50,61-70”;

                 ## SME server changes

$trunkpos=“53-60,72-80”;
$parkingpos=“50-51,69-71”;
$confepos=“46-48,65-68”;
$queuepos=“42-44,61-64”;
# End of changes
#automated generation of style-info
$extenpos=styleinfo(“Extensions”);
$trunkpos=styleinfo(“Trunks”);
$parkingpos=styleinfo(“Parking lots”);
$confepos=styleinfo(“Conferences”);
$queuepos=styleinfo(“Queues”);

PLEASE TELL WHERE TO CHANGE IN ORDER TO GET ~80 EXTENSIONS W/O OVERLAPPING

Please post a new thread as the way you change the FOP for 2.5 has changed and does not follow the rules from previous versions.