Changeset 5
- Timestamp:
- 03/14/07 20:12:29 (2 years ago)
- Files:
-
- trunk/README (modified) (2 diffs)
- trunk/RECIPES (modified) (2 diffs)
- trunk/extensions.conf.sample (modified) (1 diff)
- trunk/ming-source/operator_panel.pl (modified) (1 diff)
- trunk/op_server.pl (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/README
r1 r5 68 68 (if you are reading this you probably already done that) 69 69 70 1) Copy the files in the 'flash' or 'dhtml' subdirectory to a suitable place70 2) Copy the files in the 'flash' or 'dhtml' subdirectory to a suitable place 71 71 on your web server. If your web root is /var/www/html, you can create a 72 subdirectory 'panel' and copy the files there. 72 subdirectory 'panel' and copy the files there. The base files required 73 for the flash client are index.html and operator_panel.swf, you can also 74 copy the help files for your language. 73 75 74 76 There are several ways (index files) to load the flash applet, try them 75 77 out. You can modify the file help-xx.html files to your liking. 76 78 77 2) Edit op_server.cfg and change the appropriate parameters for your setup. 79 The dhtml panel allows you to use javascript/dhtml to desing your own 80 layout. But the client is limited to monitoring (you cannot perform 81 actions yet) 82 83 3) Edit op_server.cfg and change the appropriate parameters for your setup. 78 84 79 85 "flash_dir" parameter must be the exact location of the directory where 80 the html and swf files are placed. 86 the html and swf files are placed (where you copied the files from step 87 2 above) 81 88 82 The rest of the parameters are well commented in the cfg file 89 The rest of the parameters are well commented in the cfg file, basically 90 you have to set the manager host, user and password. (Be sure to enable 91 the manager in /etc/asterisk/manager.conf) 83 92 84 3) Edit op_buttons.cfg to suit your needs. The file is commented and its93 4) Edit op_buttons.cfg to suit your needs. The file is commented and its 85 94 self explanatory. 86 95 87 4) Edit op_style.cfg to suit your needs. You can change the button size and96 5) Edit op_style.cfg to suit your needs. You can change the button size and 88 97 colors, icon placement and size, etc. DO NOT modify the variable names, 89 98 just the value after the equal sign and DO NOT use spaces. With proper … … 122 131 ------- 123 132 124 The op_server.pl must run on the same computer as the web server 133 The op_server.pl must run on the same computer as the web server, but not 134 necesarily on the machine where asterisk is installed. 125 135 126 136 When started, it writes the file 'variables.txt' to the http directory where trunk/RECIPES
r1 r5 15 15 in extensions.conf: 16 16 17 exten => *78,1,UserEvent(ASTDB|Family: dnd^Value: On) 18 exten => *78,2,SetVar(temp=${CHANNEL}) 19 exten => *78,3,Cut(temp=temp,,1) 20 exten => *78,4,DBPut(dnd/${temp}=On) 21 exten => *78,5,Hangup 17 exten => *78,1,Set(DB(dnd/${CUT(CHANNEL|-|1)})=Break) 18 exten => *78,n,UserEvent(ASTDB|Channel: ${CHANNEL}^Family: dnd^Value: Break) 19 exten => *78,n,Hangup 22 20 23 exten => *79,1,UserEvent(ASTDB|Family: dnd^Value: ^) 24 exten => *79,2,SetVar(temp=${CHANNEL}) 25 exten => *79,3,Cut(temp=temp,,1) 26 exten => *79,4,DBDel(dnd/${temp}) 27 exten => *79,5,Hangup 21 exten => *79,1,Set(DB(dnd/${CUT(CHANNEL|-|1)})=) 22 exten => *79,n,UserEvent(ASTDB|Channel: ${CHANNEL}^Family: dnd^Value: ^) 23 exten => *79,n,Hangup 28 24 29 25 in op_astdb.cfg: 26 30 27 [dnd] 31 settext=DND: ${value} 32 setalpha=70 28 settext=DND: ${value}| 29 fopledcolor=0x001020^0|0x00A000^0 30 31 in op_buttons.cfg 32 33 [SIP/1234] 34 .. 35 astdbkey=SIP/1234 33 36 34 37 RECIPE 2 … … 43 46 44 47 [rxfax] 45 exten => s,1,Set Var(FAXFILE=/var/spool/fax/fax-${TIMESTAMP}.tif)46 exten => s,2,Set Var(LOCALSTATIONID=My Company)48 exten => s,1,Set(FAXFILE=/var/spool/fax/fax-${TIMESTAMP}.tif) 49 exten => s,2,Set(LOCALSTATIONID=My Company) 47 50 exten => s,3,UserEvent(Newexten|Channel: FAX/FAX-${UNIQUEID}^State: Up^Uniqueid: 1234) 48 51 exten => s,4,rxfax(${FAXFILE}) trunk/extensions.conf.sample
r1 r5 24 24 25 25 26 # Example on setting DND state from the dialplan27 # *78 Sets DND ON28 # *79 Sets DND OFF29 #30 # This example only sets the dnd db value and31 # signals FOP to display the status on the button32 # you might have to add a check in your stdext33 # macro to honour the DND status34 35 exten => *78,1,UserEvent(ASTDB|Family: dnd^State: On)36 exten => *78,2,SetVar(temp=${CHANNEL})37 exten => *78,3,Cut(temp=temp,,1)38 exten => *78,4,DBPut(dnd/${temp}=On)39 exten => *78,5,Hangup40 41 exten => *79,1,UserEvent(ASTDB|Family: dnd^State: ^)42 exten => *79,2,SetVar(temp=${CHANNEL})43 exten => *79,3,Cut(temp=temp,,1)44 exten => *79,4,DBDel(dnd/${temp})45 exten => *79,5,Hangup46 trunk/ming-source/operator_panel.pl
r4 r5 7494 7494 7495 7495 if (comando == "settext") { 7496 _global.ipboton[boton_numero]=textofinal; 7496 7497 setclid(statusclid,textofinal); 7497 7498 } trunk/op_server.pl
r4 r5 34 34 use POSIX qw(setsid EWOULDBLOCK); 35 35 36 my $FOP_VERSION = " SVNVERSION";36 my $FOP_VERSION = "trunk-r4"; 37 37 my %datos = (); 38 38 my %sesbot = (); … … 60 60 my %botonmeetme = (); 61 61 my %botonclid = (); 62 my %botonpermanenttext = (); 62 63 my %botonqueue = (); 63 64 my %botonqueue_count = (); … … 1051 1052 $tmphash{alarm} = "0"; 1052 1053 1053 }1054 } 1054 1055 if ( !defined( $tmphash{url} ) ) { 1055 1056 $tmphash{url} = "0"; … … 1259 1260 1260 1261 @positions = unique(@positions); 1261 1262 1262 1263 if ( defined( $tmphash{groupcount} ) ) { 1263 1264 my $count = @positions; … … 1593 1594 if ( $contextoboton eq $contexto_iterate ) { 1594 1595 $key =~ s/(\d+)\@.+/$1/g; 1595 print VARIABLES "&alarm$key=$base64_url\n";1596 } 1597 } 1598 } 1599 1596 print VARIABLES "&alarm$key=$base64_url\n"; 1597 } 1598 } 1599 } 1600 1600 1601 if ( !defined( $style_variables{$contextlower} ) ) { 1601 1602 $style_variables{$contextlower} = $style_variables{"general"}; … … 4806 4807 # Look for attendant_pending and perform a redirect of the 4807 4808 # hold channel to the same meetme room to complete the transfer 4808 4809 4809 my $canalid = $hash_temporal{Channel}; 4810 4810 my $room = ""; … … 4848 4848 if ( exists( $datos{$unico_id} ) ) { 4849 4849 $datos{$unico_id}{'State'} = "Down"; 4850 $hash_temporal{'State'} = "Down"; 4850 4851 log_debug( "$heading POPULATES datos($unico_id){ State } = down", 128 ) if DEBUG; 4851 }4852 else {4853 $hash_temporal{'State'} = "Down";4854 4852 } 4855 4853 … … 4980 4978 } 4981 4979 4982 if ( exists( $datos{$unico_id}{'State'} ) ) {4983 log_debug( "$heading EXISTE datos($unico_id){state}", 32 ) if DEBUG;4984 $state = $datos{$unico_id}{'State'};4985 }4980 #if ( exists( $datos{$unico_id}{'State'} ) ) { 4981 # log_debug( "$heading EXISTE datos($unico_id){state}", 32 ) if DEBUG; 4982 # $state = $datos{$unico_id}{'State'}; 4983 #} 4986 4984 4987 4985 if ( exists( $datos{$unico_id}{'Callerid'} ) ) { … … 5853 5851 else { 5854 5852 $botonled{$interno} = $cambia_el_led; 5855 if ( $ren_agentlogin || $ren_cbacklogin) {5853 if ( $ren_agentlogin || $ren_cbacklogin ) { 5856 5854 $botonlabel{$interno} = $dos; 5857 5855 } … … 5894 5892 } 5895 5893 else { 5894 5896 5895 # print "PERO ES DISTINTO\n$val\n$mcola|$dos\n\n"; 5897 5896 } … … 5911 5910 elsif ( $quehace eq "settext" ) { 5912 5911 if ( !defined( $group_count{$interno} ) ) { 5913 $boton clid{$interno} = $dos;5912 $botonpermanenttext{$interno} = $dos; 5914 5913 push @respuestas, "$interno|settext|$dos"; 5915 5914 } … … 7930 7929 for $interno ( keys %estadoboton ) { 7931 7930 7932 #if ( $estadoboton{$interno} !~ /^free/ ) {7933 7931 if ( $estadoboton{$interno} =~ /^busy/ ) { 7934 7932 send_status_to_flash( $socket, "$interno|state|busy", 0 ); … … 7941 7939 } 7942 7940 if ( defined( $botonclid{$interno} ) ) { 7941 my $texti = ""; 7943 7942 if ( $botonclid{$interno} ne "" ) { 7944 7943 send_status_to_flash( $socket, "$interno|settext|$botonclid{$interno}", 0 ); … … 7946 7945 } 7947 7946 7948 #} 7949 } 7947 } 7948 if ( keys(%botonpermanenttext) ) { 7949 for $interno ( keys %botonpermanenttext ) { 7950 if ( $botonpermanenttext{$interno} ne "" ) { 7951 send_status_to_flash( $socket, "$interno|settext|$botonpermanenttext{$interno}", 0 ); 7952 } 7953 } 7954 } 7955 7950 7956 if ( keys(%botonlinked) ) { 7951 7957 for $interno ( keys %botonlinked ) {
