Friday, May 16, 2008

Remastering the Asterisk Flash Operator Panel

To make the GUI chagnes in the FOP one need to change the value of the variables in respective files.

Below is the description which will enable you to change the complete look of your FOP.

Change the color and size of the Queues, Conferences, Parking, Trunks, Extensions and theri font, color etc you need to edit the op_buttons.cfg file.

the background color and size can be change by changing the values under the [rectangle].
E.g.
; Queues
[rectangle]
x=492 // indicate the starting x location of the rectangle on the screen
y=34 // indicate the starting y location of the rectangle on the screen
width=491 // this is the width of the rectangular area
height=140 // this is the height of the rectangular area
line_width=2
line_color=ffffff
fade_color1=FB7219 //the backgorund color of the block
fade_color2=ffffff //the backgorund color of the block - this will intrduce the shade - if u want a single color then keep fade_color1 and fade_color2 same
rnd_border=2
alpha=55 // This will change the intensity of the color -- higher the alpha brighter the color
layer=bottom

above is the example I have made .. cooking really cool ;)

Now if you want to change the text and fonts, edit the legend

[LEGEND]
x=500 //postition of the text - generally keep it same as the rectangle's postion
y=34 //other fields are self explainary
text=Queues
font_size=18
font_family=Arial
use_embed_fonts=1

Secondly, when you change the width and height of the panel (as it was in my case) you need to change the location of the buttion as well. To do so you need to edit the retrieve_op_conf_from_mysql.pl . This can be found under the /var/lib/asterisk/bin/.
the section below takes care of the button positions
button positions are divided in four columns among 80 (in newer version may ne 100).each column can have 20 buttons

below is my exaple -- for your need you need to change the value and test on GUI and keep repeat untill you get desired!!
######## STYLE INFO ##########
$extenpos="2-40"; //buttons of exetensions . these will occupy the first two columns
$queuepos="42-44,61-64"; // the range 40 to 60 occupies the third column so you need to adjust the queue button in 3 rd and 4th column as same for the rest
$trunkpos="53-60,72-80";
$parkingpos="50-51,69-71";
$confepos="46-48,65-68";

this was quite simple part and one can do easily. Just need to know the files

Now if you want to edit some parts in the panel's swf (flash file) then you need to go through following procedure.

(My requiement was to change the Asterisk Flash Operator panel to "XYZ" in top heading of the swf and icons of the top left panel - security, reload and help)

Change the desired values of the operator_panel.pl file in ming-source directory of operator panel.

now you need to run this file to generate the new swf file.

but, to do so you need to have ming installed, source can be found at http://sourceforge.net/projects/ming/

Inaddittion to that you need to have the file Ariale.fdb (can be found at www.asternic.org/ming.fonts/Arial.fdb)

One more thing you need to care is the version; you need to keep the version of the operator_panel.pl and op_server.pl same. If they are different then it will display warning on the panel client/server version mismatch

now, run the operator_panel.pl
that's it . You are done.

you will have the new swf file with chages. Replace the existing one with this and you will see the changes.

2 comments:

Anonymous said...

How can I remove the extra text printed in the button ??
Text like:
------------
Server = 0
CID-CallingPres = 0 (Presentation Allowed, Not Screened)
CallerID = 600
State = Down
CallerIDName =
------------

php said...

i need to change the visual stsus of the button when that particular extension is locked is that possible.