Index: /trunk/op_server.pl =================================================================== --- /trunk/op_server.pl (revision 59) +++ /trunk/op_server.pl (revision 60) @@ -1263,5 +1263,5 @@ $buttons{ uc("$tmphash{server}^$chan_trunk") } = $pos; $textos{$indice_contexto} = $tmphash{label}; - if(!defined($tmphash{no_label_counter})) { $tmphash{no_label_counter} = 0; } + if(!defined($tmphash{no_label_counter})) { $tmphash{no_label_counter} = 0; } if ( $no_counter == 0 && $tmphash{no_label_counter}==0) { $textos{$indice_contexto} .= " " . $count; @@ -4172,4 +4172,5 @@ push @return, $valor; } + $evento = ""; } elsif ( $evento eq "leave" ) { @@ -5892,6 +5893,6 @@ if ( defined( $group_count{$interno} ) ) { if ( $group_count{$interno} == 1 ) { - $buttontext = group_count($interno,$canal); - push @respuestas, $buttontext; + $buttontext = group_count($interno,$canal); + push @respuestas, $buttontext; } } @@ -6078,5 +6079,5 @@ if ( defined( $group_count{$interno} ) ) { if ( $group_count{$interno} == 1 ) { - $buttontext = group_count($interno,$canal); + $buttontext = group_count($interno,$canal); push @respuestas, $buttontext; } @@ -6091,6 +6092,6 @@ if ( defined( $group_count{$interno} ) ) { if ( $group_count{$interno} == 1 ) { - $buttontext = group_count($interno,$canal); - push @respuestas, $buttontext; + $buttontext = group_count($interno,$canal); + push @respuestas, $buttontext; } } @@ -6196,5 +6197,5 @@ } - if ( $tiempo eq "" ) { $tiempo = 0; } + if ( $tiempo eq "" ) { $tiempo = 0; } if ( $timer_type ne "" ) { @@ -6362,8 +6363,8 @@ sub group_count { - my $interno = shift; - my $canal = shift; + my $interno = shift; + my $canal = shift; my $plural = ""; - my $return = ""; + my $return = ""; if ( @{ $sesbot{$interno} } > 1 ) { $plural = "s"; @@ -6377,6 +6378,6 @@ $botonpermanenttext{$interno} = ""; $return ="$interno|corto|"; - } - return $return; + } + return $return; } @@ -8994,7 +8995,7 @@ sub recompute_queues_onjoin { my ($hash_temporal,$server,$canalid) = @_; - my @return = (); - my @corto = (); - my @ocupado = (); + my @return = (); + my @corto = (); + my @ocupado = (); my $qclidnum = ""; my $qclidname = ""; @@ -9019,5 +9020,5 @@ # Verify if the position is already taken (by means of QUEUE_PRIO) - my $tengo = 0; + my $tengo = 0; foreach my $id ( keys %{$cola} ) { unless ( $cola->{$id}{QUEUE} ) { @@ -9027,12 +9028,12 @@ if ( $canal eq $cola->{$id}{QUEUE} ) { - if ( $position eq $cola->{$id}{POSITION} ) { - $tengo = 1; - } - } - } - if($tengo==1) { + if ( $position eq $cola->{$id}{POSITION} ) { + $tengo = 1; + } + } + } + if($tengo==1) { # Queue prio! - my $time = time(); + my $time = time(); foreach my $id ( keys %{$cola} ) { unless ( $cola->{$id}{QUEUE} ) { @@ -9042,22 +9043,22 @@ if ( $canal eq $cola->{$id}{QUEUE} ) { - if($cola->{$id}{POSITION} >= $position) { - my $diftime = $time - $cola->{$id}{TIME}; - if ( $queue_hide == 1 ) { - push @corto, construct_cmd( $cola, $id, "setalpha", "000" ); - } - push @corto, construct_cmd( $cola, $id, "corto", "" ); - - $cola->{$id}{POSITION}++; - my $clidtext = $cola->{$id}{CLIDNAME} . " " . $cola->{$id}{CLID}; - push @ocupado, construct_cmd( $cola, $id, "settimer", $diftime ); - push @ocupado, construct_cmd( $cola, $id, "ocupado", "[$clidtext]" ); - } - } - } - @ocupado = unique(@ocupado); - @corto = unique(@corto); - } - # Normal, add new call at the end of the queue + if($cola->{$id}{POSITION} >= $position) { + my $diftime = $time - $cola->{$id}{TIME}; + if ( $queue_hide == 1 ) { + push @corto, construct_cmd( $cola, $id, "setalpha", "000" ); + } + push @corto, construct_cmd( $cola, $id, "corto", "" ); + + $cola->{$id}{POSITION}++; + my $clidtext = $cola->{$id}{CLIDNAME} . " " . $cola->{$id}{CLID}; + push @ocupado, construct_cmd( $cola, $id, "settimer", $diftime ); + push @ocupado, construct_cmd( $cola, $id, "ocupado", "[$clidtext]" ); + } + } + } + @ocupado = unique(@ocupado); + @corto = unique(@corto); + } + # Normal, add new call at the end of the queue push @return, "$canal=$position|ocupado2|$texto_pos|$unico_id|$canalid"; push @return, "$canal=$position|setalpha|100|$unico_id|$canalid"; @@ -9074,8 +9075,8 @@ $cola->{$canalid}{SERVER} = $server; $cola->{$canalid}{TIME} = $tiempo; - if (@corto) { + if (@corto) { return ( @corto, @ocupado, @return ); - } else { - return @return; + } else { + return @return; } } @@ -9241,5 +9242,5 @@ if ( !defined($name) ) { $name = "" } - if ( $name eq "" ) { $name = ""; } + if ( $name eq "" ) { $name = ""; } if ( !is_number($numero) ) {