Changeset 10
- Timestamp:
- 03/16/07 11:45:11 (2 years ago)
- Files:
-
- trunk/op_server.pl (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/op_server.pl
r9 r10 4742 4742 ( $canal, $sesion ) = separate_session_from_channel( $hash_temporal{Channel} ); 4743 4743 $texto = $hash_temporal{Extension}; 4744 $estado_final = "setclid"; 4744 if($texto ne "s") { 4745 $estado_final = "setclid"; 4746 } 4745 4747 } 4746 4748 else { … … 5289 5291 log_debug( "$heading GOT $mensaje", 32 ) if DEBUG; 5290 5292 delete $datos{""}; # Erase the hash with no uniqueid 5291 ( $canal, $quehace, $dos, $uniqueid, $canalid ) = 5292 split( /\|/, $mensaje ); 5293 ( $canal, $quehace, $dos, $uniqueid, $canalid ) = split( /\|/, $mensaje ); 5293 5294 5294 5295 $canalid =~ s/(.*),(\d)/$1/g; # discard ,2 on Local channels … … 5303 5304 5304 5305 if ( $dos eq "skip" ) { 5305 log_debug( "$heading SALTEO $canal tiene skip", 32 ) if DEBUG;5306 log_debug( "$heading skipping $canal $quehace (has skip)", 32 ) if DEBUG; 5306 5307 next; 5307 5308 } 5309 5308 5310 if ( $quehace eq "" ) { 5309 log_debug( "$heading SALTEO $canal no tiene quehace", 32 ) if DEBUG; 5311 log_debug( "$heading skipping $canal (empty quehace)", 32 ) if DEBUG; 5312 print "skip empty\n"; 5310 5313 next; 5311 5314 } … … 5317 5320 log_debug( "$heading canalid: $canalid", 32 ) if DEBUG; 5318 5321 5319 # if ( !defined($canal) ) { $canal = ""; } 5320 # if ( !defined($quehace) ) { $quehace = ""; } 5321 # if ( !defined($dos) ) { $dos = ""; } 5322 5323 $canalid =~ s/\s+//g; # Removes whitespace from CHANNEL-ID 5322 $canalid =~ s/\s+//g; # Removes whitespace from CHANNEL-ID 5324 5323 my $real_canal = $canalid; 5325 5324 my $canalidzombie = $canalid; # Removes whitespace from CHANNEL-ID … … 5349 5348 my @canaleja = find_panel_buttons( $canal, $canalid, $server ); 5350 5349 my $cuantos = @canaleja; 5350 5351 # Perform some pre processing... 5351 5352 5352 5353 if ( $quehace eq "corto" || $quehace eq "info" ) { … … 5376 5377 } 5377 5378 5378 } 5379 5380 if ( $quehace eq "queueremoved" ) { 5379 } elsif ( $quehace eq "queueremoved" ) { 5381 5380 5382 5381 # Remove the agent from the agents_on_queue hash … … 5422 5421 5423 5422 if ( !defined( $buttons{"$server^$canal"} ) && !defined( $buttons{"-1^$canal"} ) ) { 5424 log_debug( "$heading \t No tengo botones para $server^$canal, END FUNCTION", 128 ) if DEBUG;5423 log_debug( "$heading \tThere are no buttons for $server^$canal, skipping...", 128 ) if DEBUG; 5425 5424 if (DEBUG) { 5426 5425 for ( keys %buttons ) { … … 5434 5433 # except ocupado*, corto, setlink and unsetlink 5435 5434 if ( $canal =~ /^_/ ) { 5436 log_debug( "$heading canal $canal es un WILD y quehace vale$quehace", 32 ) if DEBUG;5435 log_debug( "$heading canal $canal is regexp, quehace value = $quehace", 32 ) if DEBUG; 5437 5436 5438 5437 if ( $quehace =~ /registr/ … … 5440 5439 || $quehace =~ /^inf/ ) 5441 5440 { 5442 log_debug( "$heading IGNOR O $quehace porque es un wildcard", 32 ) if DEBUG;5441 log_debug( "$heading IGNORING $quehace because it is a regexp match", 32 ) if DEBUG; 5443 5442 next; 5444 5443 } … … 5466 5465 my ( $canalsolo, $nrotrunk ) = split( /=/, $canal ); 5467 5466 $canal = $canalsolo . "=1" . $elcontexto; 5468 log_debug( "$heading quehace=$quehace, elijo el 1ero deltrunk $canal", 32 ) if DEBUG;5467 log_debug( "$heading quehace=$quehace, select 1st from trunk $canal", 32 ) if DEBUG; 5469 5468 5470 5469 #next; … … 5475 5474 # change it so to not change the led color. 5476 5475 if ( $quehace =~ /changelabel1/ ) { 5477 log_debug( "$heading el wildcardtiene changelabel1, lo cambio por changelabel0!", 32 )5476 log_debug( "$heading el regexp tiene changelabel1, lo cambio por changelabel0!", 32 ) 5478 5477 if DEBUG; 5479 5478 $quehace = "changelabel0"; … … 5483 5482 my $serverindex = $server; # Save the server in another var 5484 5483 5485 if ( $canal ne "" ) { 5484 if ( $canal eq "" ) { 5485 # No channel? continue... 5486 log_debug( "$heading There is no command defined", 32 ) if DEBUG; 5487 5488 } else { 5486 5489 5487 5490 $interno = $buttons{"$server^$canal"}; … … 5504 5507 } 5505 5508 } 5509 5510 # The following block cleans internal op_server states. no matter if we 5511 # have a button defined or not. 5506 5512 5507 5513 if ( $quehace eq 'corto' || $quehace eq 'info' ) { … … 5525 5531 log_debug( "$heading REMOVING datos { $uniqueid }", 32 ) if DEBUG; 5526 5532 5527 } 5528 elsif ( $quehace eq "setlink" ) { 5533 } elsif ( $quehace eq "setlink" ) { 5529 5534 5530 5535 log_debug( "$heading IF quehace = SETLINK", 32 ) if DEBUG; … … 5565 5570 log_debug( "$heading ENDIF quehace = SETLINK", 32 ) if DEBUG; 5566 5571 5567 } 5568 elsif ( $quehace eq "unsetlink" ) { 5572 } elsif ( $quehace eq "unsetlink" ) { 5569 5573 log_debug( "$heading IF quehace = UNSETLINK", 32 ) if DEBUG; 5570 5574 my @final = (); … … 5577 5581 log_debug( "$heading ENDIF quehace = UNSETLINK", 32 ) if DEBUG; 5578 5582 5579 } 5580 elsif ( $quehace eq "queueremoved" ) { 5583 } elsif ( $quehace eq "queueremoved" ) { 5581 5584 5582 5585 delete $botonvoicemail{$interno}; … … 5594 5597 } 5595 5598 5599 # Continue after cleaning internal state... 5596 5600 if ( $interno eq "" ) { 5597 log_debug( "$heading NO HAY INTERNO buttons($server^$canal), ABORTO", 32 ) if DEBUG;5601 log_debug( "$heading MISSING buttons($server^$canal), skipping...", 32 ) if DEBUG; 5598 5602 next; 5599 5603 } 5600 5604 else { 5601 log_debug( "$heading EL INTERNO es$interno", 32 ) if DEBUG;5605 log_debug( "$heading INTERNO = $interno", 32 ) if DEBUG; 5602 5606 } 5603 5607 … … 5622 5626 # 5623 5627 if ( $canalid eq "" || $canalid =~ /zombie/i || $canalid =~ /(.*)-XXXX$/ ) { 5624 log_debug( "$heading ATEN CION canalid es $canalid, NO PROCESAR?", 32 ) if DEBUG;5628 log_debug( "$heading ATENTION canalid = '$canalid', skipping...", 32 ) if DEBUG; 5625 5629 } 5626 5630 else { … … 5781 5785 5782 5786 log_debug( "$heading Continuo proceso...", 32 ) if DEBUG; 5783 5787 5784 5788 if ( $quehace =~ /changelabel/ ) { 5785 5789 log_debug( "$heading quehace = changelabel", 32 ) if DEBUG; … … 5822 5826 } 5823 5827 5824 } 5825 elsif ( $quehace eq "park" ) { 5828 } elsif ( $quehace eq "park" ) { 5826 5829 5827 5830 log_debug( "$heading quehace = park", 32 ) if DEBUG; … … 5831 5834 $timeout = time() + $timeout; 5832 5835 $botonpark{$interno} = "$texto|$timeout"; 5833 } 5834 elsif ( $quehace eq "meetmeuser" ) { 5836 } elsif ( $quehace eq "meetmeuser" ) { 5835 5837 $botonmeetme{$interno} = $dos; 5836 } 5837 elsif ( $quehace eq "infoqstat" ) { 5838 } elsif ( $quehace eq "infoqstat" ) { 5838 5839 $botonqueue{$interno} = $dos; 5839 } 5840 elsif ( $quehace eq "infoqstat2" ) { 5840 } elsif ( $quehace eq "infoqstat2" ) { 5841 5841 $botonqueue_count{$interno} = $dos; 5842 } 5843 elsif ( $quehace =~ /info/ ) { 5842 } elsif ( $quehace =~ /info/ ) { 5844 5843 my $mcola = $quehace; 5845 5844 $mcola =~ s/^info//g; … … 5852 5851 $quehace = ""; 5853 5852 } 5854 else {5855 5856 # print "PERO ES DISTINTO\n$val\n$mcola|$dos\n\n";5857 }5858 5853 } 5859 5854 else { … … 5864 5859 if ( $estaba == 0 ) { 5865 5860 push @{ $botonqueuemember{$interno} }, "$mcola|$dos"; 5866 5867 #print "NICO botonqueuemember ($interno) = $mcola y $dos\n";5868 5861 } 5869 5862 5870 } 5871 elsif ( $quehace eq "setclid" ) { 5863 } elsif ( $quehace eq "setclid" ) { 5872 5864 if ( !defined( $group_count{$interno} ) ) { 5873 5865 push @respuestas, "$interno|settext|$dos"; 5874 5866 } 5875 } 5876 elsif ( $quehace eq "settext" ) { 5867 } elsif ( $quehace eq "settext" ) { 5877 5868 if ( !defined( $group_count{$interno} ) ) { 5878 5869 $botonpermanenttext{$interno} = $dos; … … 5880 5871 push @respuestas, "$interno|settext|$dos"; 5881 5872 } 5882 } 5883 elsif ( $quehace eq "fopledcolor" ) { 5873 } elsif ( $quehace eq "fopledcolor" ) { 5884 5874 $botonledcolor{$interno} = $dos; 5885 } 5886 elsif ( $quehace eq "setalpha" ) { 5875 } elsif ( $quehace eq "setalpha" ) { 5887 5876 $botonalpha{$interno} = $dos; 5888 5877 push @respuestas, "$interno|setalpha|$dos"; 5889 } 5890 elsif ( $quehace eq "flip" ) { 5878 } elsif ( $quehace eq "flip" ) { 5891 5879 push @respuestas, "$interno|flip|$dos"; 5892 } 5893 elsif ( $quehace eq "setlabel" ) { 5880 } elsif ( $quehace eq "setlabel" ) { 5894 5881 if ( $dos ne "." 5895 5882 && $dos ne "original" … … 5899 5886 push @respuestas, "$interno|setlabel|$dos"; 5900 5887 } 5901 } 5902 elsif ( $quehace eq "voicemail" ) { 5888 } elsif ( $quehace eq "voicemail" ) { 5903 5889 $botonvoicemail{$interno} = $dos; 5904 } 5905 elsif ( $quehace eq "voicemailcount" ) { 5890 } elsif ( $quehace eq "voicemailcount" ) { 5906 5891 $botonvoicemailcount{$interno} = $dos; 5907 } 5908 elsif ( $quehace =~ "^voicemail" ) { 5892 } elsif ( $quehace =~ "^voicemail" ) { 5909 5893 5910 5894 # This block is for the voicemail client … … 5912 5896 $canalsincontexto =~ s/(.*)&(.*)/$1/g; 5913 5897 push @mensajefinal, "$canalsincontexto\@$canalsincontexto|$quehace|$dos"; 5914 } 5915 elsif ( $quehace =~ "^ringing" ) { 5898 } elsif ( $quehace =~ "^ringing" ) { 5916 5899 5917 5900 # This block is for the voicemail client, popups … … 6009 5992 } 6010 5993 6011 if ( $quehace2 !~ /isagent/ && $quehace2 !~ /^agentlogoff/ ) {5994 if ( $quehace2 !~ /isagent/ && $quehace2 !~ /^agentlogoff/ && $quehace2 !~ /^setclid/ ) { 6012 5995 log_debug( "$heading pushing respuestas $interno|$quehace2|$dos", 32 ) if DEBUG; 6013 5996 … … 6022 6005 if ( $quehace2 ne "" ) { 6023 6006 push @respuestas, "$interno|$quehace2|$dos"; 6024 6025 # print "pushing $interno $quehace2 $dos\n"; 6007 print "push $quehace2 en $interno quehace2\n"; 6026 6008 } 6027 6009 } … … 6193 6175 6194 6176 $laststatus{$interno} = $estadoboton{$interno}; 6195 }6196 else { # endif canal distinto de nada6197 log_debug( "$heading There is no command defined", 32 ) if DEBUG;6198 6177 } 6199 6178 }
