Showing posts with label Asterisk. Show all posts
Showing posts with label Asterisk. Show all posts

Friday, May 30, 2008

CDR Report Monthly Traffic

The CDR report is fantastic tool for getting call statistics on for your Asterisk.
I was configuring that for my Asterisk. I have installed the version asterisk-stat-v2_0_1 on my machine.

While testing I found the MONTHLY TRAFFIC, Pie chart inconsistence.
It is showing the proper values in the PIE CHART but the colors are not coming properly as it should.
Well, the values are coming properly, March 2008 is having 390 mins and pie hart shows it as 97%, but the color of that block of pie doesn't match, as shown below.

After much debugging I found the solution for that and it is to revert the array which feeds the data to the graph.
The pie graph is getting generated in graph_pie.php
In this file the $data is used to generate the graph (i.e it is passed in the class PieGraph).

So in order to get proper colors according to the you just need to revert the array before it get passed to the class ;)

Well, this may be probably a bug or overlooked while designing.
If you found any bugs and want to have solutions of other bugs I have found and fixed, just drop me a mail.
You will have solution in mail...

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.