How SARK UCS/MVP maps the flash operator console.
Introduction
This is a very quick how-to for the flash operator console.
There are a couple of main control files used by FOP to control the format and content of the operator console itself. One of these files you can modify directly, the other uses regular sme server templates.
The two files are
-
- /usr/local/operator/op_style.cfg
- /usr/local/operator/op_buttons.cfg
op_style.cfg
op_style.cfg is essentially the "stylesheet" for fop and you can freely modify it to suit your needs. However, you should first read the documentation on the FOP home site in order to understand what each parameter does. Here is a sample..
[general]
enable_crypto=0 ; set to 1 for encrypting server to client traffic
enable_animation=1
enable_label_background=0
use_embed_fonts=1
ledcolor_ready=0x999966
ledcolor_busy=0xff0000
ledcolor_agent=0xD0d020
label_font_size=10
label_font_family=Verdana ; only valid when use_embed_fonts is disabled
label_font_color=000000
label_shadow_color=dddddd
label_margin_top=1
label_margin_left=28
label_shadow=1
clid_font_color=4000ff
timer_font_color=4000ff
clid_font_size=10
clid_font_family=Verdana ; only valid when use_embed_fonts is disabled
clid_margin_top=1
clid_margin_left=92
timer_font_size=10
timer_font_family=Courier ; only valid when use_embed_fonts is disabled
timer_margin_top=1
timer_margin_left=173
btn_width=244
btn_height=24
btn_padding=4
btn_line_width=2
btn_line_color=0x000000
btn_fadecolor_1=CCFFFF
btn_fadecolor_2=dddddd
btn_round_border=8
btn_highlight_color=ccccff
led_scale=30
led_margin_top=8
led_margin_left=20
arrow_scale=60
arrow_margin_top=5
arrow_margin_left=5
icon1_margin_top=8
icon1_margin_left=-15
icon1_scale=4
icon2_margin_top=8
icon2_margin_left=-15
icon2_scale=4
icon3_margin_top=8
icon3_margin_left=-15
icon3_scale=4
icon4_margin_top=8
icon4_margin_left=-15
icon4_scale=4
icon5_margin_top=8
icon5_margin_left=-15
icon5_scale=4
icon6_margin_top=8
icon6_margin_left=-15
icon6_scale=4
mail_margin_left=-35
mail_margin_top=8
mail_scale=4
show_security_code=1
show_clid_info=0
show_btn_help=3
show_btn_debug=0
show_btn_reload=2
show_status=2
;[sip]
; You can have different styles per panel context
; You need to copy all the variables, they will not be
; inherited. If you fail to include an option the flash
; client migth hang. So, copy the complete [general]
; section an change the header to the panel context name.
; Then adjust the parameters to your liking.
op_buttons.cfg
op_button.cfg defines what values get placed into which buttons and also how many buttons there are and where they appear (relative to one another) on the screen. It is generated bt SAIL from a relatively trivial template which reads the SAIL database and generates the correct buttons. You can find the code at _/etc/e-smith/templates/usr/local/operator/op_buttons.cfg/10-general_
The perl code is not complex; it simply loads the correct values into the available buttons on the screen. Here is the code
{
package esmith;
use strict;
use Errno;
use esmith::config;
use esmith::util;
use esmith::db;
my %conf;
tie %conf, 'esmith::config';
my %selintra;
tie %selintra, 'esmith::config', '/home/e-smith/db/selintra';
my @Lines = ();
my @Rooms = ();
my $seq = 1;
my $span= ();
foreach (sort keys %selintra)
{
push (@Lines, $_)
if (db_get_type(\%selintra, $_) eq "IPphone");
}
foreach (@Lines)
{
my $technology = db_get_prop(\%selintra, $_, "technology") || '';
my $desc = db_get_prop(\%selintra, $_, "desc") || '';
my $shortdesc = substr($desc,0,5);
#hpe hmmm ? sounds not logical for 'Analogue' ...
unless ($seq > 75 || $technology eq 'Analogue')
{
$OUT .= "\n";
if ($technology eq 'HFC-4S-8S')
{
my $zapippfixed = db_get_prop(\%selintra, $_, "channel");
$OUT .= "[Zap/$zapippfixed]\n";
}
else
{
$OUT .= "[$technology/$_]\n";
}
$OUT .= "Position=$seq \n";
$OUT .= "Label=$_ ($shortdesc) \n";
$OUT .= "Extension=$_ \n";
$OUT .= "Context=extensions \n";
$OUT .= "Icon=1 \n";
$OUT .= "\n";
$seq++;
}
}
$seq = 63;
@Lines = ();
foreach (sort keys %selintra) {
push (@Lines, $_)
if (db_get_type(\%selintra, $_) eq "lineIO");
}
$OUT .= "[_SIP/(.{5,}|[A-Z])]\n";
$OUT .= "Position = 62\n";
$OUT .= "Count=12\n";
$OUT .= "Label=SIP Trunks\n";
$OUT .= "Extension=-1\n";
$OUT .= "Icon=4\n";
$OUT .= "groupcount=1\n";
$OUT .= "\n";
$OUT .= "[_IAX2/(.{5,}|[A-Z])]\n";
$OUT .= "Position = 63\n";
$OUT .= "Count=12\n";
$OUT .= "Label=IAX Trunks\n";
$OUT .= "Extension=-1\n";
$OUT .= "Icon=4\n";
$OUT .= "groupcount=1\n";
$OUT .= "\n";
$OUT .= "[_Zap/.*]\n";
$OUT .= "Position = 64\n";
$OUT .= "Label=ZAP Trunks\n";
$OUT .= "Count=30\n";
$OUT .= "Extension=-1\n";
$OUT .= "Icon=4\n";
$OUT .= "groupcount=1\n";
$OUT .= "\n";
$seq = 67;
@Lines = ();
foreach (sort keys %selintra)
{
push (@Lines, $_)
if (db_get_type(\%selintra, $_) eq "Queue");
}
foreach (@Lines)
{
unless ($seq > 69)
{
my $name = db_get_prop(\%selintra, $_, "name") || '';
$OUT .= "\n";
$OUT .= "[QUEUE/$_]\n";
$OUT .= "Position=$seq \n";
$OUT .= "Label=$name\n";
$OUT .= "Extension=-1\n";
$OUT .= "Icon=5\n";
$OUT .= "\n";
}
$seq++;
}
$seq = 71;
my $rooms = db_get_prop(\%selintra, 'meetme.conf', "headerlines");
@Rooms = split /\n/, $rooms;
foreach(@Rooms)
{
unless ($_ eq '[rooms]' || $seq > 74)
{
$_ =~ /(\d{1,4})/;
$OUT .= "\n";
$OUT .= "[$1]\n";
$OUT .= "Position=$seq \n";
$OUT .= "Label=\"Conf $1\"\n";
$OUT .= "Extension=$1\n";
$OUT .= "Context=conferences\n";
$OUT .= "Icon=6\n";
$OUT .= "\n";
$seq++;
}
}
$seq = 76;
my $park = db_get_prop(\%selintra, 'features.conf', "headerlines");
$park =~ /parkpos=>(\d{1,4})/;
my $parkstart = $1;
my $parkend = $parkstart + 4;
while ($parkstart lt $parkend)
{
$OUT .= "\n";
$OUT .= "[PARK/$parkstart]\n";
$OUT .= "Position=$seq \n";
$OUT .= "Label=\"Park $parkstart\"\n";
$OUT .= "Extension=$parkstart \n";
$OUT .= "Icon=3\n";
$OUT .= "\n";
$parkstart++;
$seq++;
}
}
[LEGEND]
x=780
y=32
#hpe ( Hides the first line when fop active ... not that nice.)
text= Trunklines
font_size=24
font_color=000000
font_family=Verdana ; only used when use_embed_fonts=0
use_embed_fonts=0
[LEGEND]
x=780
y=170
#hpe ( Hides the first line when fop active ... not that nice.)
text= Queues
font_size=24
font_color=000000
font_family=Verdana ; only used when use_embed_fonts=0
use_embed_fonts=0
[LEGEND]
x=780
y=283
#hpe ( Hides the first line when fop active ... not that nice.)
text= Conferences
font_size=24
font_color=000000
font_family=Verdana ; only used when use_embed_fonts=0
use_embed_fonts=0
[LEGEND]
x=780
y=423
#hpe ( Hides the first line when fop active ... not that nice.)
text= ParkedCalls
font_size=24
font_color=000000
font_family=Verdana ; only used when use_embed_fonts=0
use_embed_fonts=0
[LEGEND]
x=40
y=-4
#hpe ( Hides the first line when fop active ... not that nice.)
text=
font_size=32
font_color=000000
font_family=Ariel ; only used when use_embed_fonts=0
use_embed_fonts=0
As you can see, it addresses the individual buttons using a simple counter. You can change the number and position of various buttons by simply changing the counter values.
The section at the end of the code fragment (using LEGENDS) draws absolute values onto the screen according to their X and y co-ordinates.
-- Main.guest - 15 Mar 2008