Changeset 63
- Timestamp:
- 11/29/07 08:58:38 (1 year ago)
- Files:
-
- trunk/op_server.pl (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/op_server.pl
r62 r63 1264 1264 $buttons{ uc("$tmphash{server}^$chan_trunk") } = $pos; 1265 1265 $textos{$indice_contexto} = $tmphash{label}; 1266 if (!defined($tmphash{no_label_counter})) { $tmphash{no_label_counter} = 0; }1267 if ( $no_counter == 0 && $tmphash{no_label_counter} ==0) {1266 if ( !defined( $tmphash{no_label_counter} ) ) { $tmphash{no_label_counter} = 0; } 1267 if ( $no_counter == 0 && $tmphash{no_label_counter} == 0 ) { 1268 1268 $textos{$indice_contexto} .= " " . $count; 1269 1269 } … … 1430 1430 $tospy{$indicespy} = $tmphash{spyext}; 1431 1431 } 1432 1432 1433 1433 $/ = "\0"; 1434 1434 } … … 2899 2899 else { 2900 2900 log_debug( "$heading NO LLENO el global datos $unico_id", 64 ) if DEBUG; 2901 } 2902 } 2903 2904 # Convert Asterisk 1.4 Originate responses to 1.2 format so attendant transfers work 2905 if ( $evento eq "OriginateResponse" ) { 2906 if ( $hash_temporal{Response} eq "Success" ) { 2907 $evento = "OriginateSuccess"; 2908 } 2909 else { 2910 $evento = "OriginateFailure"; 2901 2911 } 2902 2912 } … … 4177 4187 4178 4188 push @return, "$canal|$estado_final|$texto|$unico_id|$canalid"; 4179 my @queue_events = recompute_queues_onjoin( \%hash_temporal,$server,$canalid);4189 my @queue_events = recompute_queues_onjoin( \%hash_temporal, $server, $canalid ); 4180 4190 foreach my $valor (@queue_events) { 4181 4191 push @return, $valor; … … 4762 4772 foreach my $dkey ( keys %datos ) { 4763 4773 my $ignorame = 0; 4764 my ( undef, $current_server) = split( /-/, $dkey );4774 my ( undef, $current_server ) = split( /-/, $dkey ); 4765 4775 if ( "$server" ne "$current_server" ) { 4766 4776 next; … … 5138 5148 5139 5149 if ( $state eq "Ring" ) { 5140 $texto = $canalid; 5141 $estado_final = "ring"; 5150 $texto = $canalid; 5151 $estado_final = "ring"; 5152 5142 5153 #$datos{$unico_id}{'Origin'} = "true"; 5143 5154 #log_debug( "$heading POPULATES datos($unico_id){ Origin } = true", 128 ) if DEBUG; … … 5902 5913 if ( defined( $group_count{$interno} ) ) { 5903 5914 if ( $group_count{$interno} == 1 ) { 5904 $buttontext = group_count($interno,$canal);5905 push @respuestas, $buttontext;5915 $buttontext = group_count( $interno, $canal ); 5916 push @respuestas, $buttontext; 5906 5917 } 5907 5918 } … … 6060 6071 push @mensajefinal, "$canalsincontexto\@$canalsincontexto|$quehace|$calleridpop"; 6061 6072 if ( defined( $group_count{$interno} ) && $group_count{$interno} == 1 ) { 6073 6062 6074 # Ignore ringing because of groupcount 6063 6075 $quehace = ""; … … 6088 6100 if ( defined( $group_count{$interno} ) ) { 6089 6101 if ( $group_count{$interno} == 1 ) { 6090 $buttontext = group_count( $interno,$canal);6102 $buttontext = group_count( $interno, $canal ); 6091 6103 push @respuestas, $buttontext; 6092 6104 } … … 6101 6113 if ( defined( $group_count{$interno} ) ) { 6102 6114 if ( $group_count{$interno} == 1 ) { 6103 $buttontext = group_count( $interno,$canal);6115 $buttontext = group_count( $interno, $canal ); 6104 6116 push @respuestas, $buttontext; 6105 6117 } … … 6171 6183 if ( $quehace2 ne "" ) { 6172 6184 if ( defined( $group_count{$interno} ) && $group_count{$interno} == 1 ) { 6185 6173 6186 # $dos = ""; 6174 6187 } … … 6199 6212 } 6200 6213 if ( $quehace2 eq "settimer" ) { 6201 if ( !defined( $dos ) ) { $dos=1; }6214 if ( !defined($dos) ) { $dos = 1; } 6202 6215 my $tiempo = $dos; 6203 6216 my $timer_type = ""; … … 6206 6219 } 6207 6220 6208 if ( $tiempo eq "" ) { $tiempo = 0; }6221 if ( $tiempo eq "" ) { $tiempo = 0; } 6209 6222 6210 6223 if ( $timer_type ne "" ) { … … 6374 6387 my $interno = shift; 6375 6388 my $canal = shift; 6376 my $plural = "";6377 my $return = "";6389 my $plural = ""; 6390 my $return = ""; 6378 6391 if ( @{ $sesbot{$interno} } > 1 ) { 6379 $plural = "s";6392 $plural = "s"; 6380 6393 } 6381 6394 if ( @{ $sesbot{$interno} } > 0 ) { 6382 my $cuantos = @{ $sesbot{$interno} }; 6383 my ( $text, $textriginal, $buttontext ) = translate( $canal, "&channels,$cuantos,$plural", "", "" ); 6384 $return = "$interno|settext|$text"; 6385 $botonpermanenttext{$interno} = $text; 6386 } else { 6387 $botonpermanenttext{$interno} = ""; 6388 $return ="$interno|corto|"; 6395 my $cuantos = @{ $sesbot{$interno} }; 6396 my ( $text, $textriginal, $buttontext ) = translate( $canal, "&channels,$cuantos,$plural", "", "" ); 6397 $return = "$interno|settext|$text"; 6398 $botonpermanenttext{$interno} = $text; 6399 } 6400 else { 6401 $botonpermanenttext{$interno} = ""; 6402 $return = "$interno|corto|"; 6389 6403 } 6390 6404 return $return; … … 7416 7430 my $cuantos = @cuales_transferir; 7417 7431 7418 if ( !defined( $tospy{$btn_destino} ) ) {7432 if ( !defined( $tospy{$btn_destino} ) ) { 7419 7433 7420 7434 # If there is no spy extension defined, change it to a standard … … 7454 7468 return; 7455 7469 7456 } 7457 7458 } elsif ( $accion =~ /^tovoicemail/ ) { 7470 } 7471 7472 } 7473 elsif ( $accion =~ /^tovoicemail/ ) { 7459 7474 7460 7475 my @cuales_transferir = get_transfer_channel( $origin_channel, $datosflash ); … … 7500 7515 return; 7501 7516 } 7502 } elsif ( $accion =~ /^voicemail/ ) { 7517 } 7518 elsif ( $accion =~ /^voicemail/ ) { 7503 7519 my $vext = ""; 7504 7520 my $vcontext = ""; … … 9046 9062 9047 9063 sub recompute_queues_onjoin { 9048 my ( $hash_temporal,$server,$canalid) = @_;9049 my @return = ();9050 my @corto = ();9051 my @ocupado = ();9064 my ( $hash_temporal, $server, $canalid ) = @_; 9065 my @return = (); 9066 my @corto = (); 9067 my @ocupado = (); 9052 9068 my $qclidnum = ""; 9053 9069 my $qclidname = ""; … … 9066 9082 my $texto_pos = "[$qclidname $qclidnum]"; 9067 9083 9068 my $canal = "QUEUE/" . $hash_temporal->{Queue};9084 my $canal = "QUEUE/" . $hash_temporal->{Queue}; 9069 9085 my $position = $hash_temporal->{Position}; 9070 9086 $canal =~ tr/a-z/A-Z/; … … 9085 9101 } 9086 9102 } 9087 if($tengo==1) { 9103 if ( $tengo == 1 ) { 9104 9088 9105 # Queue prio! 9089 9106 my $time = time(); … … 9095 9112 9096 9113 if ( $canal eq $cola->{$id}{QUEUE} ) { 9097 if ($cola->{$id}{POSITION} >= $position) {9114 if ( $cola->{$id}{POSITION} >= $position ) { 9098 9115 my $diftime = $time - $cola->{$id}{TIME}; 9099 9116 if ( $queue_hide == 1 ) { … … 9111 9128 @ocupado = unique(@ocupado); 9112 9129 @corto = unique(@corto); 9113 } 9130 } 9131 9114 9132 # Normal, add new call at the end of the queue 9115 9133 push @return, "$canal=$position|ocupado2|$texto_pos|$unico_id|$canalid"; … … 9119 9137 if ( defined( $hash_temporal->{Wait} ) ) { 9120 9138 $tiempo = $tiempo - $hash_temporal->{Wait}; 9121 push @return, "$canal=$position|settimer|" .$hash_temporal->{Wait}."\@UP|$unico_id|$canalid";9139 push @return, "$canal=$position|settimer|" . $hash_temporal->{Wait} . "\@UP|$unico_id|$canalid"; 9122 9140 } 9123 9141 $cola->{$canalid}{POSITION} = $position; … … 9128 9146 $cola->{$canalid}{TIME} = $tiempo; 9129 9147 if (@corto) { 9130 return ( @corto, @ocupado, @return ); 9131 } else { 9132 return @return; 9148 return ( @corto, @ocupado, @return ); 9149 } 9150 else { 9151 return @return; 9133 9152 } 9134 9153 } … … 9181 9200 push @ocupado, construct_cmd( $cola, $id, "settimer", $diftime ); 9182 9201 push @ocupado, construct_cmd( $cola, $id, "ocupado", "[$clidtext]" ); 9202 9183 9203 #push @ocupado, $cola->{$id}{QUEUE} . "|ocupado|[$clidtext]|" . $cola->{$id}{QUEUE} . "-" . $cola->{$id}{SERVER} . "|$id"; 9184 9204 push @ocupado, $cola->{$id}{QUEUE} . "|settimer|0\@STOP|" . $cola->{$id}{QUEUE} . "-" . $cola->{$id}{SERVER} . "|$id";
